package main import ( "fmt" "strings" ) func main() { fmt.Println("查找子串是否在指定的字符串中") fmt.Println("1 Contains 函数的用法") fmt.Println(strings.Contains("seafood", "foo")) //true fmt.Println(strings.Contains("seafood", "bar")) //false fmt.Println(strings.Contains("seafood", "")) //true fmt.Println(strings.Contains("", "")) //true 这里要特别注意 fmt.Println(strings.Contains("我是中国人", "我")) //true fmt.Println("") fmt.Println("2 ContainsAny 函数的用法") fmt.Println(strings.ContainsAny("team",… 

Buffers are extremely useful in Go and I’ve written a little about them before. Part of that has been around rendering HTML templates: ExecuteTemplate returns an error, but if you’ve passed it your http.ResponseWriter it’s… 

Go currently (pre 1.5) doesn’t provide any built in method for vendoring packages. The tools that currently exist today (godep, nut and a few others) basically exploit the implementation details of $GOPATH. Go 1.5 however… 

draw包提供了图片的生成方法,或者绘制方法.其使用方法只需导入响应的包即可"import image/draw” func Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point, op Op) Draw是DrawMask的一种特殊形式,当DrawMask方法中mask为nil时,便是Draw函数 func DrawMask(dst Image, r image.Rectangle, src image.Image, sp image.Point, mask image.Image, mp image.Point, op Op) 其中各个参数的含义如下: dst 绘图的背景图。 r 是背景图的绘图区域 src…