Add more tests and comments for Godoc
This commit is contained in:
12 files changed
+345
-23
No files matched your search
@@ -20,6 +20,8 @@ const (
|
||||
NumberMaxResults = uint32(100)
|
||||
)
|
||||
|
||||
// GoogleClient contains clients and attributes for authenticating to Google Cloud
|
||||
// and finding instances
|
||||
type GoogleClient struct {
|
||||
InstancesClient *compute.InstancesClient
|
||||
InstanceGroupClient *compute.InstanceGroupsClient
|
||||
@@ -76,6 +78,10 @@ func instanceToHost(instance *computepb.Instance) (*pb.ListHostsResponseHost, er
|
||||
return nil, errors.New("response integrity error: missing instance self-link")
|
||||
}
|
||||
|
||||
if instance.GetName() == "" {
|
||||
return nil, errors.New("response integrity error: missing instance name")
|
||||
}
|
||||
|
||||
result := new(pb.ListHostsResponseHost)
|
||||
|
||||
result.ExternalId = instance.GetSelfLink()
|
||||
|
||||
Reference in new issue
Block a user