Skip to content

Commit

Permalink
introduce MakeVariantWithSignature
Browse files Browse the repository at this point in the history
Allow user to explicitly specifiy variant signature rather than
autodetect it.
phoracek committed Aug 13, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent bd29ed6 commit ea50d34
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion variant.go
Original file line number Diff line number Diff line change
@@ -17,7 +17,12 @@ type Variant struct {
// MakeVariant converts the given value to a Variant. It panics if v cannot be
// represented as a D-Bus type.
func MakeVariant(v interface{}) Variant {
return Variant{SignatureOf(v), v}
return MakeVariantWithSignature(v, SignatureOf(v))
}

// MakeVariantWithSignature converts the given value to a Variant.
func MakeVariantWithSignature(v interface{}, s Signature) Variant {
return Variant{s, v}
}

// ParseVariant parses the given string as a variant as described at

0 comments on commit ea50d34

Please sign in to comment.