99designs / 99designs/gqlgen

Fails when built with -trimpath

Open
#910 7 comments 0 reactions 0 assignees View on GitHub
accepted bug
Dominant language
Go
Stars
10.8k
Forks
1.3k
Avg merge
2d 36m
Merged PRs (30d)
26

Description

### What happened?

```
$ GOFLAGS='-trimpath' go build github.com/99designs/gqlgen && ./gqlgen
modelgen: locating templates: lstat github.com/99designs/gqlgen@v0.10.1/plugin/modelgen: no such file or directory
[EXIT:3] $
```

### What did you expect?

Success, like without `-trimpath`:

```
$ GOFLAGS=' ' go build github.com/99designs/gqlgen && ./gqlgen
$
```

### Minimal graphql.schema and models to reproduce

Just about anything, really.

### versions
- `gqlgen version`?
- `go version`?
- dep or go modules?

```
$ go list -m github.com/99designs/gqlgen
github.com/99designs/gqlgen v0.10.1
$ go version
go version go1.13.3 linux/amd64
```

And obviously modules.

It seems gqlgen is using build-time paths to try to locate its template files, and trimpath confuses that. Perhaps the templates should be bundled into the executable.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.