douduan5753 2014-03-28 17:33
浏览 67
已采纳

生成go文件时出现未定义的错误

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

  • 写回答

1条回答 默认 最新

  • dongqiongjiong4740 2014-03-31 21:11
    关注

    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...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数