Skip to content

Commit 3d382df

Browse files
Added .gitignore and directory structuring
1 parent bd0d273 commit 3d382df

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Binary files
2+
/bin/
3+
4+
# for macOS dev environments
5+
.DS_Store
6+
7+
# Env files
8+
.env
9+
.env.*

Makefile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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)

cmd/laclm/main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
)
6+
7+
func main() {
8+
fmt.Println("Hello World")
9+
}

main.go

Whitespace-only changes.

0 commit comments

Comments
 (0)