luraproject / lura

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 "key"
27	}
28	buff := []byte(URLPattern)
29	for k, v := range r.Params {
30		key := []byte{}31		key = append(key, "{{."...)
32		key = append(key, k...)
33		key = append(key, "}}"...)
Empty slice literal of type "[]error" used to define "errors"
116}
117
118func load(ctx context.Context, plugins []string, rmf RegisterModifierFunc, logger logging.Logger) (int, error) {
119	errors := []error{}120	loadedPlugins := 0
121	for k, pluginName := range plugins {
122		if err := open(ctx, pluginName, rmf, logger); err != nil {
Empty slice literal of type "[]error" used to define "errors"
 52}
 53
 54func load(plugins []string, rcf RegisterHandlerFunc, logger logging.Logger) (int, error) {
 55	errors := []error{} 56	loadedPlugins := 0
 57	for k, pluginName := range plugins {
 58		if err := open(pluginName, rcf, logger); err != nil {
Empty slice literal of type "[]error" used to define "errors"
 52}
 53
 54func load(plugins []string, rcf RegisterClientFunc, logger logging.Logger) (int, error) {
 55	errors := []error{} 56	loadedPlugins := 0
 57	for k, pluginName := range plugins {
 58		if err := open(pluginName, rcf, logger); err != nil {
Empty slice literal of type "[]string" used to define "paths"
 43	engine.HandleMethodNotAllowed = true
 44	engine.ContextWithFallback = true
 45
 46	paths := []string{} 47
 48	ginOptions := engineConfiguration{}
 49	if v, ok := cfg.ExtraConfig[Namespace]; ok {