Skip to content

Instantly share code, notes, and snippets.

@indrasaputra
Last active October 18, 2018 03:32
Show Gist options
  • Save indrasaputra/bf80af29e6573e03afc6e0cddb62d381 to your computer and use it in GitHub Desktop.
Save indrasaputra/bf80af29e6573e03afc6e0cddb62d381 to your computer and use it in GitHub Desktop.
func main() {
ctx := context.Background()
kube := &Kubernetes{}
checker := &Checker{}
services, _ := kube.AllServices(ctx)
// let's make a new services container
// so we don't bother with pointer
var result []*Service
var errorLog [][]error
for _, svc := range services {
res, errs := checker.CheckStandards(ctx, svc)
if errs != nil {
errorLog = append(errorLog, errs)
}
result = append(result, res)
}
// do the rest as you like
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment