Closed orible closed 3 years ago
Not sure which input is being referenced by "contentError"
Is this v3.1.2 or v3.1.1?
Maybe it works if your project is inside your GOPATH but it should also work outside but maybe try to put in the GOPATH
Interesting, 🤔
My project is in my gopath, I append the "E:/src/" folder (or something similar to that effect) to the env path.
I initially had trouble with the boiler parse and schema write step, but after adding a branch for null.JSON => string, it's succeeding there.
Can't quite tell what's going on when it's complaining about src.go.
🤔 As you say, it might very well be my gopath setup, I'll have a go at poking around with that.
Traced the bug to:
v3@v3.1.2/templates/templates.go
54: node, err := parser.ParseFile(fSet, "src.go", string(importFixedContent), 0)
I notice this occurs as so:
"// This example demonstrates how to inspect the AST of a Go program"
the resolver plugin is trying to parse an empty syntax tree source
importsError returning:
:<go/scanner.Error> Pos:<go/token.Position> Filename:"E:/server/resolver.go" Offset:853 Line:38 Column:14 Msg:"unknown escape sequence"
pre parse resolver.go
at the end of the import header:
`
github.com/rs/zerolog/log"
. "server/helpers"
dm "server/model/database"
fm "server/graphql_models"
gm "server\graphql_models"
` It seems it's added an import with an incorrect directory separator
Providing incorrect directory join
given directory path with single backslashes
Eg:
E:\src\myapp\resolver.go
This function instead of
correctly handles transforming the system path to a valid one
See:
Problem semi fixed.
Though I'll have to create new issue requests for some more problems I've encountered.
Thanks a lot!! I did a pre-release with your PR
8:15PM DBG [resolver] generate file 8:15PM ERR could not parse golang file error="src.go:1:1: expected 'package', found 'EOF'" error while trying generate resolver and converts resolver-webridge: errors while writing template to E:/server/resolver.go writeError:,
contentError: formatting: 38:14: unknown escape sequence, importError: E:/server/resolver.go:38:14: unknown escape sequence
exit status 3
And this is the contents of Resolver.go:
" package
"