3 // Copyright 2020 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Check that batch files are maintained as CRLF files (consistent behaviour
8 // on all operating systems). See https://github.com/golang/go/issues/37791
22 batches, _ := filepath.Glob(runtime.GOROOT() + "/src/*.bat")
23 for _, bat := range batches {
24 body, _ := ioutil.ReadFile(bat)
25 if !bytes.Contains(body, []byte("\r\n")) {
26 fmt.Printf("Windows batch file %s does not contain CRLF line termination.\nTry running git checkout src/*.bat to fix this.\n", bat)