Move the command to cmd/sfdupes and the code to internal/sfdupes (closes #157)
check / check (push) Failing after 20m3s
check / check (push) Failing after 20m3s
The root held every .go file in package main, so no ref had the path cmd/sfdupes that go install was given. cmd/sfdupes/main.go now only calls sfdupes.Main; the rest is package internal/sfdupes, with main.go renamed to cli.go. The Makefile builds ./cmd/sfdupes and sets Version by its new import path. README and TODO.md give the new install path and file paths. The test files carry //nolint:testpackage: they test unexported functions, which the linter allowed only in package main. Model: opus-5-5
This commit is contained in:
1 parent
7cb10ed303
commit
b5ff4f720f
27 files changed
+120
-96
No files matched your search
@@ -4,7 +4,7 @@ export CGO_ENABLED = 0
|
||||
|
||||
BINARY := sfdupes
|
||||
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
|
||||
LDFLAGS := -X main.Version=$(VERSION)
|
||||
LDFLAGS := -X sneak.berlin/go/sfdupes/internal/sfdupes.Version=$(VERSION)
|
||||
|
||||
.PHONY: sfdupes build bootstrap setup test lint fmt fmt-check check docker hooks clean
|
||||
|
||||
@@ -14,7 +14,7 @@ LDFLAGS := -X main.Version=$(VERSION)
|
||||
# Default target: build the binary. Phony so go build (which has its
|
||||
# own build cache) always decides what to recompile.
|
||||
sfdupes:
|
||||
go build -ldflags "$(LDFLAGS)" -o $(BINARY)
|
||||
go build -ldflags "$(LDFLAGS)" -o $(BINARY) ./cmd/sfdupes
|
||||
|
||||
build: sfdupes
|
||||
|
||||
|
||||
Reference in new issue
Block a user