CI: also use go tool for gosimports

This commit is contained in:
ziggie authored and yyforyongyu committed 2025-11-12 22:54:02 +08:00
1 parent d2d56f2968
commit b6dd3a32f7
2 files changed
+7 -8

No files matched your search

+6 -7
View File
@@ -1,16 +1,19 @@
PKG := github.com/lightningnetwork/lnd
MOBILE_PKG := $(PKG)/mobile
TOOLS_DIR := tools
TOOLS_MOD := $(TOOLS_DIR)/go.mod
GOCC ?= go
PREFIX ?= /usr/local
GOTOOL := GOWORK=off $(GOCC) tool -modfile=$(TOOLS_MOD)
BTCD_PKG := github.com/btcsuite/btcd
GOIMPORTS_PKG := github.com/rinchsan/gosimports/cmd/gosimports
GO_BIN := ${GOPATH}/bin
BTCD_BIN := $(GO_BIN)/btcd
GOIMPORTS_BIN := $(GO_BIN)/gosimports
GOMOBILE_BIN := $(GO_BIN)/gomobile
MOBILE_BUILD_DIR :=${GOPATH}/src/$(MOBILE_PKG)/build
@@ -88,10 +91,6 @@ $(BTCD_BIN):
@$(call print, "Installing btcd.")
cd $(TOOLS_DIR); $(GOCC) install -trimpath $(BTCD_PKG)
$(GOIMPORTS_BIN):
@$(call print, "Installing goimports.")
cd $(TOOLS_DIR); $(GOCC) install -trimpath $(GOIMPORTS_PKG)
# ============
# INSTALLATION
# ============
@@ -315,9 +314,9 @@ fuzz:
# =========
#? fmt: Format source code and fix imports
fmt: $(GOIMPORTS_BIN)
fmt:
@$(call print, "Fixing imports.")
gosimports -w $(GOFILES_NOVENDOR)
$(GOTOOL) $(GOIMPORTS_PKG) -w $(GOFILES_NOVENDOR)
@$(call print, "Formatting source.")
gofmt -l -w -s $(GOFILES_NOVENDOR)
+1 -1
View File
@@ -232,5 +232,5 @@ tool (
// Once golangci-lint v2.4.1 update it here.
// Also don't forget to update the .custom-gcl.yml file.
github.com/golangci/golangci-lint/v2/cmd/golangci-lint
github.com/rinchsan/gosimports
github.com/rinchsan/gosimports/cmd/gosimports
)