The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
skyFuture

请问 go 的单元测试怎么写

  •  
  •   skyFuture · Apr 18, 2018 · 2746 views
    This topic created in 2975 days ago, the information mentioned may be changed or developed.

    用 goLand 的 ide 编写 go 的单元测试,但是一 run 就发现 ./w_test.go:11:7: undefined: NewWeightedRR ./w_test.go:11:21: undefined: RR_NGINX ./w_test.go:60:7: undefined: NewWeightedRR ./w_test.go:60:21: undefined: RR_LVS

    说是我的引用有点问题,请问哪位 v 友遇到过吗

    4 replies    2018-04-18 19:34:52 +08:00
    cloudzhou
        1
    cloudzhou  
       Apr 18, 2018
    go test
    LuoyeBug
        2
    LuoyeBug  
       Apr 18, 2018
    上代码呀,github 有个 gotests 工具,挺省事的。
    gowk
        3
    gowk  
       Apr 18, 2018
    justfortest
        4
    justfortest  
       Apr 18, 2018
    你是不是没有以 package 方式执行?这样会导致一些 exported variable/method 无法被引用。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5957 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 162ms · UTC 06:12 · PVG 14:12 · LAX 23:12 · JFK 02:12
    ♥ Do have faith in what you're doing.