diff --git a/Makefile.template b/Makefile.template new file mode 100644 index 0000000..5d74391 --- /dev/null +++ b/Makefile.template @@ -0,0 +1,21 @@ +.DEFAULT_GOAL := build + +fmt: + go fmt ./... +.PHONY:fmt + +lint: fmt + revive ./... +.PHONY:lint + +vet: fmt + go vet ./... +.PHONY:vet + +build: vet + go build -o hello_world hello.go +.PHONY:build + +clean: + rm rf ./hello_world +.PHONY:clean diff --git a/ch1/.gitignore b/ch1/.gitignore new file mode 100644 index 0000000..242c034 --- /dev/null +++ b/ch1/.gitignore @@ -0,0 +1 @@ +hello_world diff --git a/ch1/Makefile b/ch1/Makefile new file mode 100644 index 0000000..5d74391 --- /dev/null +++ b/ch1/Makefile @@ -0,0 +1,21 @@ +.DEFAULT_GOAL := build + +fmt: + go fmt ./... +.PHONY:fmt + +lint: fmt + revive ./... +.PHONY:lint + +vet: fmt + go vet ./... +.PHONY:vet + +build: vet + go build -o hello_world hello.go +.PHONY:build + +clean: + rm rf ./hello_world +.PHONY:clean diff --git a/ch1/go.mod b/ch1/go.mod new file mode 100644 index 0000000..5857ec8 --- /dev/null +++ b/ch1/go.mod @@ -0,0 +1,3 @@ +module ch1 + +go 1.20 diff --git a/ch1/hello.go b/ch1/hello.go new file mode 100644 index 0000000..6b5e726 --- /dev/null +++ b/ch1/hello.go @@ -0,0 +1,10 @@ +// Package hello +// +// This package provides a simple "hello, world" program. +package main + +import "fmt" + +func main() { + fmt.Println("Hello Golang!") +}