Compare commits
No commits in common. "bbaf15660119b82361da04400a28d92ff2578a97" and "fd798451f462489e2e6da648f3cd06761902d97d" have entirely different histories.
bbaf156601
...
fd798451f4
7 changed files with 12 additions and 61 deletions
19
.gitignore
vendored
19
.gitignore
vendored
|
@ -1,19 +0,0 @@
|
||||||
# Binaries for programs and plugins
|
|
||||||
*.exe
|
|
||||||
*.exe~
|
|
||||||
*.dll
|
|
||||||
*.so
|
|
||||||
*.dylib
|
|
||||||
bin
|
|
||||||
|
|
||||||
# Test binary, built with `go test -c`
|
|
||||||
*.test
|
|
||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
|
||||||
*.out
|
|
||||||
|
|
||||||
# Dependency directories (remove the comment below to include it)
|
|
||||||
vendor/
|
|
||||||
|
|
||||||
# Go workspace file
|
|
||||||
go.work
|
|
15
justfile
15
justfile
|
@ -1,15 +0,0 @@
|
||||||
run:
|
|
||||||
cd src && go run .
|
|
||||||
|
|
||||||
build:
|
|
||||||
mkdir -p bin
|
|
||||||
cd src && go build -o ../bin/main .
|
|
||||||
|
|
||||||
test:
|
|
||||||
cd src && go test -v .
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf bin/*
|
|
||||||
|
|
||||||
format:
|
|
||||||
go fmt src/*.go
|
|
11
makefile
Normal file
11
makefile
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
run:
|
||||||
|
go run src/*.go
|
||||||
|
|
||||||
|
build:
|
||||||
|
go build -o bin/main src/main.go
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf bin/*
|
||||||
|
|
||||||
|
format:
|
||||||
|
go fmt src/*.go
|
|
@ -1,6 +0,0 @@
|
||||||
package main
|
|
||||||
|
|
||||||
// Sophisticated mathematics for sophisticated homosapiens
|
|
||||||
func add(x, y int) int {
|
|
||||||
return x + y
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This file is named add_test.go by convention.
|
|
||||||
// The go test command will automatically detect this file and run it.
|
|
||||||
// All test files must be named *_test.go and all test functions must be named Test*.
|
|
||||||
|
|
||||||
// TestAdd is a test function
|
|
||||||
func TestAdd(t *testing.T) {
|
|
||||||
if add(1, 2) != 3 {
|
|
||||||
t.Error("Expected 3")
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import "fmt"
|
||||||
"fmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Greets the world
|
|
||||||
func greet() {
|
func greet() {
|
||||||
fmt.Println("Hello World!")
|
fmt.Println("Hello World!")
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,5 +2,4 @@ package main
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
greet()
|
greet()
|
||||||
println(add(1, 2))
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue