You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scenario: editing a .go file that's hasn't been saved yet. (For example, for rapid greenfield prototyping of stuff via some sort of go run-based REPL-ish tool like gore.) The source is sent as usual via -modified flag and stdin archive format. When -pos is something like Untitled-1.go:#pos, all documentation requests via -json (say, hovering over the strings.ToLower or anything that should have docs) will always return couldn't find Untitled-1 in program. Or if name is empty, similarly couldn't find in program (2 spaces).
Here's an easy-repro session:
[23:42 me ~/.../github.com/metaleap]$ gogetdoc -json -modified -pos untitled.go:#94
untitled.go
136
package tmp
import "strings"
func test (val string) string {
if val[0]=='u' {return strings.ToUpper(val)}
return "Nope not happn'g"
}
gogetdoc: couldn't find untitled.go in program
[23:49 me ~/.../github.com/metaleap]$
Of course no file named untitled.go exists on disk, but would be awesome if gogetdoc could handle that, given that it read the program from stdin anyway! The given -pos 94 should be between the T and o of ToUpper if my editor didn't fool me.
The text was updated successfully, but these errors were encountered:
Oddly enough, just found that guru too gives a strikingly similarly worded message in such a scenario: file Untitled-1 not found in loaded program --- makes me wonder, why look for any file when it's supplied via stdin though!
Scenario: editing a .go file that's hasn't been saved yet. (For example, for rapid greenfield prototyping of stuff via some sort of
go run
-based REPL-ish tool likegore
.) The source is sent as usual via-modified
flag and stdin archive format. When-pos
is something likeUntitled-1.go:#pos
, all documentation requests via-json
(say, hovering over thestrings.ToLower
or anything that should have docs) will always returncouldn't find Untitled-1 in program
. Or if name is empty, similarlycouldn't find in program
(2 spaces).Here's an easy-repro session:
Of course no file named
untitled.go
exists on disk, but would be awesome ifgogetdoc
could handle that, given that it read the program from stdin anyway! The given-pos
94 should be between theT
ando
ofToUpper
if my editor didn't fool me.The text was updated successfully, but these errors were encountered: