Skip to content

Commit

Permalink
Update tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
kkyr committed Dec 12, 2023
1 parent ba54e94 commit ad2f398
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions fig.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,36 +31,35 @@ const (
// StringUnmarshaler is an interface for custom unmarshaling of strings
//
// If a field with a local type asignment satisfies this interface, it allows the user
// to implment their own custom type unmarshaling method.
// to implement their own custom type unmarshaling method.
//
// Example:
//
// type ListenerType uint

// const (
// ListenerUnix ListenerType = iota
// ListenerTCP
// ListenerTLS
// )
// type ListenerType uint
//
// type Config struct {
// Listener ListenerType `fig:"listener_type" default:"unix"`
// }
// const (
// ListenerUnix ListenerType = iota
// ListenerTCP
// ListenerTLS
// )
//
// func (l *ListenerType) UnmarshalType(v string) error {
// switch strings.ToLower(v) {
// case "unix":
// *l = ListenerUnix
// case "tcp":
// *l = ListenerTCP
// case "tls":
// *l = ListenerTLS
// default:
// return fmt.Errorf("unknown listener type: %s", v)
// }
// return nil
// }
// type Config struct {
// Listener ListenerType `fig:"listener_type" default:"unix"`
// }
//
// func (l *ListenerType) UnmarshalType(v string) error {
// switch strings.ToLower(v) {
// case "unix":
// *l = ListenerUnix
// case "tcp":
// *l = ListenerTCP
// case "tls":
// *l = ListenerTLS
// default:
// return fmt.Errorf("unknown listener type: %s", v)
// }
// return nil
// }
type StringUnmarshaler interface {
UnmarshalString(s string) error
}
Expand Down

0 comments on commit ad2f398

Please sign in to comment.