func get_fs_info() *rtn {
type junk struct {
stuff
}
var rtn [20]junk
.
.
more stuff
.
.
return &rtn
}
why does Go complain about an unknow var “rtn”
func get_fs_info() *rtn {
type junk struct {
stuff
}
var rtn [20]junk
.
.
more stuff
.
.
return &rtn
}
why does Go complain about an unknow var “rtn”
Because you have toi returna a type (well also you can return a named var). So change your code to
func get_fs_info() *[20]junk
Also take out type junk struct {
stuff
}
from function
so… my scruct has to be gobal…
yes, it will be known for each func in your code. If you name it with a Intiial uppercase it is a exported struct.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.