Skip to content

Commit

Permalink
golang hello world
Browse files Browse the repository at this point in the history
 - with test
 - with github actions CI

Signed-off-by: Morgan Bauer <[email protected]>
  • Loading branch information
MHBauer committed Mar 31, 2020
1 parent bb52da1 commit 68c7586
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Go

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Build
run: go build -v .

- name: test
run: go test -v -race
Empty file removed .travis.yml
Empty file.
11 changes: 11 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package main

import "fmt"

func main() {
fmt.Println(Greet())
}

func Greet() string {
return "Hello, World!"
}
13 changes: 13 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main_test

import (
"testing"

main "."
)

func TestGreet(t *testing.T) {
if main.Greet() != "Hello, World!" {
t.Fail()
}
}

0 comments on commit 68c7586

Please sign in to comment.