From 3e350f4d6659674427952385441fce40c444bb4d Mon Sep 17 00:00:00 2001 From: Maxim Kurbatov Date: Mon, 11 Nov 2024 14:56:44 +0500 Subject: [PATCH] Update files --- .gitignore | 3 ++- Makefile | 30 ++++++++++++++++++++++++++++++ go.mod | 2 +- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 97787f4..37d6d1b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ test-config/ -./keenetic-pbr \ No newline at end of file +./keenetic-pbr +bin/ \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..449b1df --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +PKG_VERSION:=1.0.0 +PKG_RELEASE:=1 +PKG_FULLVERSION:=$(PKG_VERSION)-$(PKG_RELEASE) + +BINARY_NAME=keenetic-pbr + +build: + GOARCH=amd64 GOOS=linux go build -o bin/${BINARY_NAME}-linux-amd64 main.go + +run: build + ./bin/${BINARY_NAME} + +clean: + go clean + rm ./bin/${BINARY_NAME}-linux-amd64 + +test: + go test ./... + +test_coverage: + go test ./... -coverprofile=coverage.outg + +dep: + go mod download + +vet: + go vet + +lint: + golangci-lint run --enable-all diff --git a/go.mod b/go.mod index 0e1f40c..dcc9761 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module maksimkurb/keenetic-pbr go 1.22 -require github.com/BurntSushi/toml v1.4.0 // indirect +require github.com/BurntSushi/toml v1.4.0