Merge pull request #22 from CesarGallego/master

basic go build process
This commit is contained in:
Roberto Abdelkader Martínez Pérez
2019-09-04 15:16:29 +02:00
committed by GitHub
5 changed files with 58 additions and 0 deletions
+1
View File
@@ -1 +1,2 @@
__pycache__
coverage.html
+16
View File
@@ -0,0 +1,16 @@
.PHONY: test install acceptance deps
all: acceptance
test: deps
go test -race -coverprofile=/tmp/c.out github.com/BBVA/kapow/pkg/...
go tool cover -html=/tmp/c.out -o coverage.html
install: test
go install github.com/BBVA/kapow/...
acceptance: install
make -C spec/test
deps:
@echo "deps here"
+12
View File
@@ -0,0 +1,12 @@
package main
import (
"fmt"
b "github.com/BBVA/kapow/pkg/banner"
)
func main() {
ban := b.Banner("0.1.0")
fmt.Println(ban)
}
+18
View File
@@ -0,0 +1,18 @@
package banner
import "fmt"
func Banner(version string) string {
return fmt.Sprintf(`
___ __ ________ ________ ________ ___ __ ___
|\ \|\ \ |\ __ \|\ __ \|\ __ \|\ \ |\ \|\ \
\ \ \/ /|\ \ \|\ \ \ \|\ \ \ \|\ \ \ \ \ \ \ \ \
\ \ ___ \ \ __ \ \ ____\ \ \\\ \ \ \ __\ \ \ \ \
\ \ \\ \ \ \ \ \ \ \ \___|\ \ \\\ \ \ \|\__\_\ \ \__\
\ \__\\ \__\ \__\ \__\ \__\ \ \_______\ \____________\|__|
\|__| \|__|\|__|\|__|\|__| \|_______|\|____________| ___
|\__\
\|__|
ver: %s
`, version)
}
+11
View File
@@ -0,0 +1,11 @@
package banner
import "testing"
func TestBanner(t *testing.T) {
ban := Banner("0.0.0")
if ban == "" {
t.Errorf("Banner expected KAPOW!!!, but got %v", ban)
t.Fail()
}
}