Selaa lähdekoodia

Fix function comments based on best practices from Effective Go

Signed-off-by: CodeLingo Bot <bot@codelingo.io>
CodeLingo Bot 6 vuotta sitten
vanhempi
commit
101c2116ab
2 muutettua tiedostoa jossa 5 lisäystä ja 5 poistoa
  1. 4 4
      pkg/ip/ipnet.go
  2. 1 1
      subnet/kube/kube.go

+ 4 - 4
pkg/ip/ipnet.go

@@ -77,12 +77,12 @@ func (ip IP4) StringSep(sep string) string {
 	return fmt.Sprintf("%d%s%d%s%d%s%d", a, sep, b, sep, c, sep, d)
 }
 
-// json.Marshaler impl
+// MarshalJSON: json.Marshaler impl
 func (ip IP4) MarshalJSON() ([]byte, error) {
 	return []byte(fmt.Sprintf(`"%s"`, ip)), nil
 }
 
-// json.Unmarshaler impl
+// UnmarshalJSON: json.Unmarshaler impl
 func (ip *IP4) UnmarshalJSON(j []byte) error {
 	j = bytes.Trim(j, "\"")
 	if val, err := ParseIP4(string(j)); err != nil {
@@ -163,12 +163,12 @@ func (n IP4Net) Empty() bool {
 	return n.IP == IP4(0) && n.PrefixLen == uint(0)
 }
 
-// json.Marshaler impl
+// MarshalJSON: json.Marshaler impl
 func (n IP4Net) MarshalJSON() ([]byte, error) {
 	return []byte(fmt.Sprintf(`"%s"`, n)), nil
 }
 
-// json.Unmarshaler impl
+// UnmarshalJSON: json.Unmarshaler impl
 func (n *IP4Net) UnmarshalJSON(j []byte) error {
 	j = bytes.Trim(j, "\"")
 	if _, val, err := net.ParseCIDR(string(j)); err != nil {

+ 1 - 1
subnet/kube/kube.go

@@ -328,7 +328,7 @@ func (ksm *kubeSubnetManager) nodeToLease(n v1.Node) (l subnet.Lease, err error)
 	return l, nil
 }
 
-// unimplemented
+// RenewLease: unimplemented
 func (ksm *kubeSubnetManager) RenewLease(ctx context.Context, lease *subnet.Lease) error {
 	return ErrUnimplemented
 }