func ExtractYear(fname string) int {
	raw, err := ioutil.ReadFile(fname)
	if err != nil {
		return gopherYear
	}
	if !bytes.HasPrefix(raw, []byte("// Copyright")) {
		return gopherYear
	}
	raw = bytes.TrimPrefix(raw, []byte("// Copyright ©"))
	raw = bytes.TrimPrefix(raw, []byte("// Copyright "))
	idx := bytes.Index(raw, []byte("The go-hep Authors"))
	raw = bytes.TrimSpace(raw[:idx])

	year, err := strconv.Atoi(string(raw))
	if err != nil {
		return gopherYear
	}
	return year
}
// ExtractYear returns the copyright year of a Go-HEP header file.
ExtractYear returns the copyright year of a Go-HEP header file.
// ExtractYear returns the copyright year of a Go - HEP header file .
func ExtractYear(fname string) int {
	raw, err := ioutil.ReadFile(fname)
	if err != nil {
		return gopherYear
	}
	if !bytes.HasPrefix(raw, []byte("// Copyright")) {
		return gopherYear
	}
	raw = bytes.TrimPrefix(raw, []byte("// Copyright ©"))
	raw = bytes.TrimPrefix(raw, []byte("// Copyright "))
	idx := bytes.Index(raw, []byte("The go-hep Authors"))
	raw = bytes.TrimSpace(raw[:idx])
	year, err := strconv.Atoi(string(raw))
	if err != nil {
		return gopherYear
	}
	return year
}
func ExtractYear ( fname string ) int { raw , err := ioutil . ReadFile ( fname ) if err != nil { return gopherYear } if ! bytes . HasPrefix ( raw , [ ] byte ( " " ) ) { return gopherYear } raw = bytes . TrimPrefix ( raw , [ ] byte ( " ) ) raw = bytes . TrimPrefix ( raw , [ ] byte ( " " ) ) idx := bytes . Index ( raw , [ ] byte ( " " ) ) raw = bytes . TrimSpace ( raw [ : idx ] ) year , err := strconv . Atoi ( string ( raw ) ) if err != nil { return gopherYear } return year }
ExtractYear returns the copyright year of a Go-HEP header file.
ExtractYear returns the copyright year of a Go - HEP header file .