Created
April 8, 2019 15:28
-
-
Save ruanbekker/38b5acd07da0750d0dadd7ffda08ad79 to your computer and use it in GitHub Desktop.
Drone with Golang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
workspace: | |
base: /go | |
path: src/github.com/drone-demos/drone-with-go | |
pipeline: | |
test: | |
image: golang:latest | |
commands: | |
- go vet | |
- go test -v -cover | |
build: | |
image: golang:latest | |
commands: | |
- go build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
fmt.Println(HelloWorld()) | |
} | |
func HelloWorld() string { | |
return "hello world" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"os" | |
"testing" | |
) | |
func TestMain(m *testing.M) { | |
os.Exit(m.Run()) | |
} | |
func TestHelloWorld(t *testing.T) { | |
if HelloWorld() != "hello world" { | |
t.Errorf("got %s expected %s", HelloWorld(), "hello world") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment