1

I have a simple go file like below

package main

import (
    "flag"
)

var port = flag.Int("port", 23456, "port to listen.")

func main() {
    flag.Parse()
}

It was no problem when I built it yesterday, but after upgrade to go1.2.1, I get below error.

d:\dev\golang>go build main.go
# flag
C:\Go\src\pkg\flag\flag.go:87: undefined: strconv.ParseBool

Tried to uninstall 1.2.1 and re-install 1.2, same result.

Can anybody tell me why? I really appreciate any help you can provide.

go version: go1.2.windows-amd64, go1.2.1.windows-amd64
windows 7 64 bit

3
  • Something in your go install is broken. Either there's a very old strconv missing ParseBool in your path (pre go1), or something is masking the stdlib strconv. Make sure to clean out all the old files if you reinstalled. Commented Mar 28, 2014 at 21:19
  • Show the output of go env. Commented Mar 28, 2014 at 23:46
  • Maybe you have an old version of Go installed some where? Commented Mar 31, 2014 at 16:39

1 Answer 1

0

Okay, finally I found the solution.

After I renamed C:\Go\pkg\windows_amd64 to windows_amd64\windows_amd64_111, system automatically recreated a C:\Go\pkg\windows_amd64 folder for me, and then, everything goes OK.

Still don't know why...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.