Skip to content

Instantly share code, notes, and snippets.

@cimadai
Created November 28, 2015 11:33
Show Gist options
  • Save cimadai/5d1a1569626b1a76f425 to your computer and use it in GitHub Desktop.
Save cimadai/5d1a1569626b1a76f425 to your computer and use it in GitHub Desktop.
drone.io用のサンプルコード
package sample
func Sum(xs ...int) (s int) {
for _, x := range xs {
s += x
}
return
}
package sample
import "testing"
func TestSum(t *testing.T) {
expect := 55
actual := Sum(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
if actual != expect {
t.Errorf(`expect="%d" actual="%d"`, expect, actual)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment