Vendor main dependencies.
This commit is contained in:
parent
49a09ab7dd
commit
dd5e3fba01
2738 changed files with 1045689 additions and 0 deletions
30
vendor/github.com/tv42/zbase32/flag.go
generated
vendored
Normal file
30
vendor/github.com/tv42/zbase32/flag.go
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
package zbase32
|
||||
|
||||
import "flag"
|
||||
|
||||
// Value implements flag parsing for zbase32 values.
|
||||
type Value []byte
|
||||
|
||||
var _ flag.Value = (*Value)(nil)
|
||||
|
||||
// String returns the z-base-32 encoding of the value.
|
||||
func (v *Value) String() string {
|
||||
return EncodeToString(*v)
|
||||
}
|
||||
|
||||
// Set the value to data encoded by string.
|
||||
func (v *Value) Set(s string) error {
|
||||
b, err := DecodeString(s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*v = b
|
||||
return nil
|
||||
}
|
||||
|
||||
var _ flag.Getter = (*Value)(nil)
|
||||
|
||||
// Get the data stored in the value. Returns a value of type []byte.
|
||||
func (v *Value) Get() interface{} {
|
||||
return []byte(*v)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue