cmd icon indicating copy to clipboard operation
cmd copied to clipboard

Failed to parse port as integer: %!s(int=-1)

Open perrornet opened this issue 3 years ago • 2 comments

system: Windows 10

go version go version go1.13.3 windows/amd64

go env:

set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\qinya\AppData\Local\go-build
set GOENV=C:\Users\qinya\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=E:\go
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=C:\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=E:\my-app1\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\qinya\AppData\Local\Temp\go-build459198110=/tmp/go-build -gno-record-gcc-switches

revel version:

Revel executing: displays the Revel Framework and Go version
Revel Framework :       Unknown (Unknown remote master branch)
Revel Cmd       :       1.0.0   (Unknown remote master branch)
Revel Modules   :       Unknown (Unknown remote master branch)

start project cmd:

revel new -a my-app -r

ouput:

Revel executing: create a skeleton Revel application
Your application has been created in:
   E:\my-app
WARN  16:02:56 harness.go:175: No http.addr specified in the app.conf listening on localhost interface only. This will not allow external access to your application
Changed detected, recompiling
Parsing packages, (may require download if not cached)... Completed
?[32mINFO ?[0m 16:03:20    app     run.go:34: Running revel server
?[32mINFO ?[0m 16:03:20    app   plugin.go:9: Go to /@tests to run the tests.
Revel proxy is listening, point your browser to : 9000Revel engine is listening on.. localhost:8529

run project cmd:

revel run my-app1 dev

ouput:

CRIT  16:42:24 revel_logger.go:59: Failed to parse port as integer: %!s(int=-1)

perrornet avatar Jul 20 '20 08:07 perrornet

This behavior does not occur in go 1.14.2, it appears that this line https://github.com/revel/cmd/blob/master/revel/run.go#L78 is passing so that the conversion from the third argument is attempted and fails. Please either upgrade Go or use the flags to prevent this from occurring like

revel run -a my-app1 -m dev

notzippy avatar Jul 20 '20 22:07 notzippy

It also occurs in 1.14.6

$ revel run my-app dev
CRIT  22:18:43 revel_logger.go:59: Failed to parse port as integer: %!s(int=-1) 
$ revel version
Revel executing: displays the Revel Framework and Go version
Revel Framework :       Unknown (1.0.0 remote master branch)
Revel Cmd       :       1.0.0   (1.0.0 remote master branch)
Revel Modules   :       Unknown (1.0.0 remote master branch)


Go Location:C:\Go\bin\go.exe

go version go1.14.6 windows/amd64

revel run -a my-app -m dev works instead

goevexx avatar Jul 25 '20 20:07 goevexx