Skip to content

Commit

Permalink
Driveby: fix missing and incorrect docs
Browse files Browse the repository at this point in the history
  • Loading branch information
peterklijn committed Oct 26, 2022
1 parent c04e4bb commit 1305af0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ The fields have to be one of the types that the sync package supports in order t
- sync.TimeDuration, allows for concurrent time.duration manipulation.
- sync.Regexp, allows for concurrent *regexp.Regexp manipulation.
- sync.StringMap, allows for concurrent map[string]string manipulation.
- sync.StringSlice, allows for concurrent []string manipulation.

For sensitive configuration (passwords, tokens, etc.) that shouldn't be printed in log, you can use the `Secret` flavor of `sync` types. If one of these is selected, then at harvester log instead of the real value the text `***` will be displayed.

Expand Down
12 changes: 6 additions & 6 deletions sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (b *Bool) MarshalJSON() ([]byte, error) {
return json.Marshal(b.value)
}

// MarshalJSON returns the JSON encoding of the value.
// UnmarshalJSON returns the JSON encoding of the value.
func (b *Bool) UnmarshalJSON(d []byte) error {
b.rw.RLock()
defer b.rw.RUnlock()
Expand Down Expand Up @@ -93,7 +93,7 @@ func (i *Int64) MarshalJSON() ([]byte, error) {
return json.Marshal(i.value)
}

// MarshalJSON returns the JSON encoding of the value.
// UnmarshalJSON returns the JSON encoding of the value.
func (i *Int64) UnmarshalJSON(d []byte) error {
i.rw.RLock()
defer i.rw.RUnlock()
Expand Down Expand Up @@ -144,7 +144,7 @@ func (f *Float64) MarshalJSON() ([]byte, error) {
return json.Marshal(f.value)
}

// MarshalJSON returns the JSON encoding of the value.
// UnmarshalJSON returns the JSON encoding of the value.
func (f *Float64) UnmarshalJSON(d []byte) error {
f.rw.RLock()
defer f.rw.RUnlock()
Expand Down Expand Up @@ -195,7 +195,7 @@ func (s *String) MarshalJSON() ([]byte, error) {
return json.Marshal(s.value)
}

// MarshalJSON returns the JSON encoding of the value.
// UnmarshalJSON returns the JSON encoding of the value.
func (s *String) UnmarshalJSON(d []byte) error {
s.rw.RLock()
defer s.rw.RUnlock()
Expand Down Expand Up @@ -242,7 +242,7 @@ func (s *TimeDuration) MarshalJSON() ([]byte, error) {
return json.Marshal(s.value)
}

// MarshalJSON returns the JSON encoding of the value.
// UnmarshalJSON returns the JSON encoding of the value.
func (s *TimeDuration) UnmarshalJSON(d []byte) error {
s.rw.RLock()
defer s.rw.RUnlock()
Expand Down Expand Up @@ -291,7 +291,7 @@ func (s *Secret) MarshalJSON() (out []byte, err error) {
return json.Marshal(s.String())
}

// MarshalJSON returns the JSON encoding of the value.
// UnmarshalJSON returns the JSON encoding of the value.
func (s *Secret) UnmarshalJSON(d []byte) error {
s.rw.RLock()
defer s.rw.RUnlock()
Expand Down

0 comments on commit 1305af0

Please sign in to comment.