Michael Grosser, the Blog

Google+ LinkedIn Twitter

Menu

Skip to content
  • Home
  • About

Tag Archives: Makefile

Makefile: speedup go build & run by using mtimes

  • No need to rebuild your binary when nothing about it could have changed
  • go build -o foo && ./foo is faster than go run
# Makefile
BINARY = my-app
$(BINARY): $(shell find pkg cmd -type f -name "*.go" ! -name "*_test.go") go.mod go.sum
	go build -o $(BINARY) cmd/main.go

.PHONY: build
build: $(BINARY) ## Build binary

.PHONY: run
run: build ## run
	./$(BINARY) --help

2024-03-09pragmatig golang, Makefile Leave a comment
  • Whats my Coverage? (C0 C1 C2 C3 + Path)
  • Fluentd Kubernetes Metadata via Kubelet
  • Automated Sudo Password Prompt with SshKit

Recent Posts

  • Testing Kubernetes CEL admission/valdiation
  • Producing Golang error backtraces / stacktraces
  • Makefile: speedup go build & run by using mtimes
  • Datadog: Show Metric Usage Warning From HPA Metrics
  • Kubernetes Changelog from Audit log
Create a website or blog at WordPress.com
  • Subscribe Subscribed
    • Michael Grosser, the Blog
    • Already have a WordPress.com account? Log in now.
    • Michael Grosser, the Blog
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar