stacktraces.go
func getSourceLines(file string) [][]byte {
	fileSources.Lock()
	defer fileSources.Unlock()
	if fileSources.lines == nil {
		fileSources.lines = map[string][][]byte{}
	}
	if lines, ok := fileSources.lines[file]; ok {
		return lines
	}
	text, _ := ioutil.ReadFile(file)
	fileSources.lines[file] = bytes.Split(text, []byte{'\n'})
	return fileSources.lines[file]
}
func getSourceLines(file string) [][]byte {
	fileSources.Lock()
	defer fileSources.Unlock()
	if fileSources.lines == nil {
		fileSources.lines = map[string][][]byte{}
	}
	if lines, ok := fileSources.lines[file]; ok {
		return lines
	}
	text, _ := ioutil.ReadFile(file)
	fileSources.lines[file] = bytes.Split(text, []byte{'\n'})
	return fileSources.lines[file]
}
func getSourceLines ( file string ) [ ] [ ] byte { fileSources . Lock ( ) defer fileSources . Unlock ( ) if fileSources . lines == nil { fileSources . lines = map [ string ] [ ] [ ] byte { } } if lines , ok := fileSources . lines [ file ] ; ok { return lines } text , _ := ioutil . ReadFile ( file ) fileSources . lines [ file ] = bytes . Split ( text , [ ] byte { '\n' } ) return fileSources . lines [ file ] }
// Reads souce file lines from disk if not cached already.
Reads souce file lines from disk if not cached already .