This is a very stupid question, but I cannot get my head around it.
I am trying to use an old package for a very simple task.
The package in question is bitbucket.org/proteinspector/ms/unthermo
All I need to do is to use unthermo.Open
to read a specific file and get some info out of it.
Now, when I look at the source code of unthermo
I can see that Open
is implemented as:
func Open(fn string) (file File, err error) {
f, err := os.Open(fn)
// more stuff...
//the info I need for now
scanindex := make(ScanIndex, nScans)
readBetween(f, rh.ScanindexAddr, rh.ScantrailerAddr, ver, scanindex)
// more stuff...
return File{f: f, scanevents: scanevents, scanindex: scanindex}, err
}
however in my application I cannot access the field scanindex
func main() {
//open file
file, _ := unthermo.Open("somefile")
defer file.Close()
//this does not compile
info := file.scanindex
fmt.Println(info)
}
why?