File tree Expand file tree Collapse file tree 4 files changed +58
-0
lines changed Expand file tree Collapse file tree 4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ # Binary files
2+ /bin /
3+
4+ # for macOS dev environments
5+ .DS_Store
6+
7+ # Env files
8+ .env
9+ .env. *
Original file line number Diff line number Diff line change 1+ APP_NAME = laclm
2+ CMD_DIR = ./cmd/$(APP_NAME )
3+ BIN_DIR = ./bin
4+ BIN_PATH = $(BIN_DIR ) /$(APP_NAME )
5+
6+ GOFILES := $(shell find . -name '* .go' -type f)
7+
8+ .PHONY : all build clean run test lint build-linux build-mac build-win
9+
10+ all : build
11+
12+ # # Build the app
13+ build : $(GOFILES )
14+ @echo " Building $( APP_NAME) ..."
15+ @mkdir -p $(BIN_DIR )
16+ go build -o $(BIN_PATH ) $(CMD_DIR )
17+
18+ # # Run the app
19+ run : build
20+ @echo " Running $( APP_NAME) ..."
21+ @$(BIN_PATH )
22+
23+ # # Clean build artifacts
24+ clean :
25+ @echo " Cleaning..."
26+ @rm -rf $(BIN_DIR )
27+
28+ # # Run tests
29+ test :
30+ @echo " Running tests..."
31+ go test ./...
32+
33+ # # Lint (requires golangci-lint)
34+ lint :
35+ @echo " Linting..."
36+ @golangci-lint run
37+
38+ # # Cross-build for Linux
39+ build-linux :
40+ GOOS=linux GOARCH=amd64 go build -o $(BIN_DIR ) /$(APP_NAME ) -linux $(CMD_DIR )
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ "fmt"
5+ )
6+
7+ func main () {
8+ fmt .Println ("Hello World" )
9+ }
You can’t perform that action at this time.
0 commit comments