Empty slice literal used to declare a variable GO-W1027
Anti-pattern
Minor
6 months agoa year old
Empty slice literal of type "[]byte" used to define "bytes"
417
418// getServerCA returns a byte slice containing the PEM encoding of the server's CA certificate
419func getServerCA(server *httptest.Server) []byte {
420	bytes := []byte{}421	for i, cert := range server.TLS.Certificates {
422		if i == 0 {
423			continue // Just return the chain, not the leaf server cert
Empty slice literal of type "[]string" used to define "envList"
489	splitter := func(c rune) bool {
490		return c == ','
491	}
492	envList := []string{}493	envList = append(envList, strings.FieldsFunc(os.Getenv("NO_PROXY"), splitter)...)
494	envList = append(envList, strings.FieldsFunc(os.Getenv("no_proxy"), splitter)...)
495	envList = append(envList,
Empty slice literal of type "[]string" used to define "endpoints"
568		return nil, err
569	}
570
571	endpoints := []string{}572	return endpoints, json.Unmarshal(data, &endpoints)
573}
574
Empty slice literal of type "[]string" used to define "fileList"
128			}
129		}
130	}
131	fileList := []string{}132	for _, service := range cmds.ServicesList {
133		logrus.Infof("Rotating certificates for %s service", service)
134		switch service {
Empty slice literal of type "[]error" used to define "errs"
 88// - The new leaf CA certificates must be verifiable using the same root and intermediate certs as the current leaf CA certificates.
 89// - The new service account signing key bundle must include the currently active signing key.
 90func validateBootstrap(oldServer, newServer *config.Control) error {
 91	errs := []error{} 92
 93	// Use reflection to iterate over all of the bootstrap fields, checking files at each of the new paths.
 94	oldMeta := reflect.ValueOf(&oldServer.Runtime.ControlRuntimeBootstrap).Elem()