-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecret.go
More file actions
29 lines (23 loc) · 647 Bytes
/
secret.go
File metadata and controls
29 lines (23 loc) · 647 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package config
// Secret tries to hide the self's content while printing.
type Secret string
// GoString implements fmt.GoStringer.
func (Secret) GoString() string {
return "***"
}
// MarshalJSON implements json.Marshaler.
func (Secret) MarshalJSON() ([]byte, error) {
return []byte(`"***"`), nil
}
// MarshalText implements encoding.TextMarshaler.
func (Secret) MarshalText() (text []byte, err error) {
return []byte("***"), nil
}
// MarshalYAML implements gopkg.in/yaml.Marshaler.
func (Secret) MarshalYAML() (interface{}, error) {
return "***", nil
}
// String implements fmt.Stringer.
func (Secret) String() string {
return "***"
}