3

I am getting following error on running revel app in development mode. I am posting logs below

INFO  2016/06/14 16:18:17 build.go:172: Cleaning dir tmp
INFO  2016/06/14 16:18:17 build.go:172: Cleaning dir routes
2016/06/14 16:18:17 reflect.go:728: Failed to generate name for field. Make sure the field name is valid.
2016/06/14 16:18:17 reflect.go:728: Failed to generate name for field. Make sure the field name is valid.
2016/06/14 16:18:17 reflect.go:728: Failed to generate name for field. Make sure the field name is valid.
INFO  2016/06/14 16:18:17 build.go:172: Cleaning dir tmp
INFO  2016/06/14 16:18:17 build.go:172: Cleaning dir routes
ERROR 2016/06/14 16:18:19 build.go:101: # gocars-api-core/app/tmp
/home/deploy/.gvm/gos/go1.6/pkg/tool/linux_amd64/link: -X flag requires argument of the form importpath.name=value

ERROR 2016/06/14 16:18:19 build.go:298: Failed to parse build errors:
 # gocars-api-core/app/tmp
/home/deploy/.gvm/gos/go1.6/pkg/tool/linux_amd64/link: -X flag requires argument of the form importpath.name=value

Also on running revel build I am getting following error

deploy@ip-172-xx-xx-x9 ~/gocars $ revel build gocars-api-core ./buiding1
~
~ revel! http://revel.github.io
~
INFO  2016/06/15 15:52:51 revel.go:365: Loaded module static
INFO  2016/06/15 15:52:51 revel.go:230: Initialized Revel v0.13.1 (2016-06-06) for >= go1.4
INFO  2016/06/15 15:52:51 build.go:172: Cleaning dir tmp
INFO  2016/06/15 15:52:51 build.go:172: Cleaning dir routes
2016/06/15 15:52:51 reflect.go:728: Failed to generate name for field. Make sure the field name is valid.
2016/06/15 15:52:51 reflect.go:728: Failed to generate name for field. Make sure the field name is valid.
2016/06/15 15:52:51 reflect.go:728: Failed to generate name for field. Make sure the field name is valid.
INFO  2016/06/15 15:52:51 build.go:172: Cleaning dir tmp
INFO  2016/06/15 15:52:51 build.go:172: Cleaning dir routes
TRACE 2016/06/15 15:52:51 build.go:94: Exec: [/home/deploy/.gvm/gos/go1.6/bin/go build -ldflags -X gocars-api-core/app.APP_VERSION "" -tags  -o /home/deploy/gocars/bin/revel.d/gocars-api-core/gocars-api-core gocars-api-core/app/tmp]
ERROR 2016/06/15 15:52:54 build.go:101: # gocars-api-core/app/tmp
/home/deploy/.gvm/gos/go1.6/pkg/tool/linux_amd64/link: -X flag requires argument of the form importpath.name=value

ERROR 2016/06/15 15:52:54 build.go:298: Failed to parse build errors:
 # gocars-api-core/app/tmp
/home/deploy/.gvm/gos/go1.6/pkg/tool/linux_amd64/link: -X flag requires argument of the form importpath.name=value

I am new to revel and not sure why this compilation error is coming?

Paritosh Singh
  • 6,288
  • 5
  • 37
  • 56
  • Are you using the latest version of revel? It's calling the go command with invalid parameters. (or are you adding an `-ldflags -X` option somewhere?) – JimB Jun 14 '16 at 13:17
  • Yeah I am using version v0.13.1. No I am not adding any flag here. – Paritosh Singh Jun 14 '16 at 16:00
  • It looks like the revel command hasn't been kept up to date, and the `github.com/revel/cmd/harness` package doesn't format the linker flags correctly. You can bypass this by not using the `watch` option (or you can patch the build.go file in the harness package) – JimB Jun 14 '16 at 16:10
  • @JimB I have checked both revel and revel cmd are on v0.12.0 now, but same problem. – Paritosh Singh Jun 15 '16 at 10:21
  • 1
    I'm not saying you're doing anything wrong, the revel command is broken. I think you can disable the "watch" option, use an older release of go, or patch the ldflags option on the revel source. – JimB Jun 15 '16 at 10:50

0 Answers0