Skip to content

Instantly share code, notes, and snippets.

@ruanbekker
Created April 8, 2019 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruanbekker/38b5acd07da0750d0dadd7ffda08ad79 to your computer and use it in GitHub Desktop.
Save ruanbekker/38b5acd07da0750d0dadd7ffda08ad79 to your computer and use it in GitHub Desktop.
Drone with Golang
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
package main
import "fmt"
func main() {
fmt.Println(HelloWorld())
}
func HelloWorld() string {
return "hello world"
}
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