小编Jer*_*all的帖子

运行hello.go程序时文件不存在错误

我正在关注 go 文档并尝试运行 hello.go。我在 Windows 7 上并使用 msi 安装程序安装 go 1.1.2。我有文件“C:\Go\pkg\tool\windows_386\8g.exe”(参见下面的目录输出),但是当我执行“go.exe run hello.go”时,我得到文件不存在错误。

请帮忙。谢谢你。

C:\>go.exe run hello.go
go build command-line-arguments: exec: "C:\\Go\\pkg\\tool\\windows_386\\8g.exe":
 file does not exist

C:\>go.exe version
go version go1.1.2 windows/386

C:\>go.exe run hello.go
go build command-line-arguments: exec: "C:\\Go\\pkg\\tool\\windows_386\\8g.exe":
 file does not exist

C:\>dir C:\\Go\\pkg\\tool\\windows_386\\8g.exe
The specified path is invalid.

C:\>dir C:\Go\pkg\tool\\windows_386\\8g.exe
 Volume in drive C is Local Disk
 Volume Serial Number is C07E-54F5

 Directory of C:\Go\pkg\tool\windows_386

08/13/2013  07:04 AM         1,831,416 8g.exe
               1 File(s)      1,831,416 bytes
               0 Dir(s)  11,407,892,480 …
Run Code Online (Sandbox Code Playgroud)

windows go

5
推荐指数
1
解决办法
3594
查看次数

GoLang,"hash.Write","write()"函数来自哪里?

func hash(s string) uint32 {
    h := fnv.New32a()
    h.Write([]byte(s))
    return h.Sum32()
}
Run Code Online (Sandbox Code Playgroud)

对于这段代码.我明白什么类型是h.这是哈希.但是对于Hash类型,我没有看到任何Write()方法.http://golang.org/pkg/hash/ 这是什么写的()?

谢谢

go

2
推荐指数
1
解决办法
785
查看次数

在CPAN中有一个很好的库来过滤掉跨站点脚本(XSS)吗?

CPAN中是否有一个很好的库可以过滤掉所有不良内容的文本字段,比如xss?

security xss perl

1
推荐指数
1
解决办法
1158
查看次数

去常规的奇怪行为

我只是尝试了下面的代码,但结果似乎有点奇怪.它首先打印奇数,然后打偶数.我真的很困惑.我原本希望它输出奇数和偶数一个接一个,就像1,2,3,4 ...... 谁能帮我?

package main

import (
    "fmt"
    "time"
)

func main() {
    go sheep(1)
    go sheep(2)
    time.Sleep(100000)
}

func sheep(i int) {
    for ; ; i += 2 {
        fmt.Println(i,"sheeps")
    }
}
Run Code Online (Sandbox Code Playgroud)

concurrency go goroutine

0
推荐指数
1
解决办法
217
查看次数

标签 统计

go ×3

concurrency ×1

goroutine ×1

perl ×1

security ×1

windows ×1

xss ×1