Przeglądaj źródła

Make unnecessarily global variable local

Lu Stadler 7 lat temu
rodzic
commit
51cb636717
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      go/fake-http/fake-http.go

+ 2 - 2
go/fake-http/fake-http.go

@ -39,8 +39,6 @@ func init() {
39 39
	flag.BoolVar(&flags.proxyMinikube, "proxy-minikube", false, "Shortcut for -proxy-url https://$(minikube ip):8443 -proxy-client-cert ~/.minikube/client.crt -proxy-client-key ~/.minikube/client.key")
40 40
}
41 41
42
var responses Responses
43
44 42
func main() {
45 43
	flag.Parse()
46 44
@ -56,6 +54,7 @@ func main() {
56 54
		responsesPath = flag.Arg(0)
57 55
	}
58 56
57
	var responses Responses
59 58
	requestLog := Log(make([]LogEntry, 0))
60 59
61 60
	http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
@ -361,6 +360,7 @@ func (rs *Responses) loadFile(path string) ([]Response, error) {
361 360
		return nil, err
362 361
	}
363 362
363
	var responses Responses
364 364
	err = yaml.Unmarshal(out, &responses)
365 365
	if err != nil {
366 366
		return nil, err