2014-10-09 聚會手記

上一週 || 下一週

Table of Contents

roy

可以線上繪製ER Diagram的工具
https://www.draw.io

tsaikd

LiteIDE - golang 的 IDE, save 的時候會自動跑 gofmt

godep , 可以把專案的相依性固定在特定版本
https://github.com/tools/godep

stretchr/testify - A sacred extension to the standard go testing package
go 好用的 unittest 函式庫
https://github.com/stretchr/testify

yan

Visitors - fast web log analyzer
http://www.hping.org/visitors/

Pathalizer: Visual website usage analysis
http://pathalizer.sourceforge.net/

$ go test

math.go

package modules                                                                                                  
// Sqrt returns an approximation to the square root of x.
func Sqrt(x float64) float64 {
    z := 1.0 
    for i := 0; i < 1000; i++ {
        z -= (z*z - x) / (2 * z)
    }   
    return z
}

math_test.go

package modules                                                                                                  
import (
    "testing"
)   

func TestSqrt(t *testing.T) { 
    if(Sqrt(4) != 2) {
        t.Error("error")
    } else {
        t.Log("success")
    }
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License