From 87e57c187084ebc9f136d0ab7ab9d8d208cc7077 Mon Sep 17 00:00:00 2001 From: Drew Bednar Date: Sat, 5 Aug 2023 14:51:24 -0400 Subject: [PATCH] First chapter setup --- Makefile.template | 21 +++++++++++++++++++++ ch1/.gitignore | 1 + ch1/Makefile | 21 +++++++++++++++++++++ ch1/go.mod | 3 +++ ch1/hello.go | 10 ++++++++++ 5 files changed, 56 insertions(+) create mode 100644 Makefile.template create mode 100644 ch1/.gitignore create mode 100644 ch1/Makefile create mode 100644 ch1/go.mod create mode 100644 ch1/hello.go 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!") +}