postgres_exporter
postgres_exporter copied to clipboard
Compilation fails for on FreeBSD 13 , postgresql13 , go-1.17.1,1
What did you do? git pull --rebase gmake clean gmake
What did you expect to see? Compilation without errors
What did you see instead? Under which circumstances?
"go fmt test.go" works fine.
"which gofmt" returns /usr/local/bin/gofmt
But gmake produces: gmake: *** [Makefile.common:126: common-style] Error 1
Environment
-
System information: FreeBSD 13.0-RELEASE-p4 amd64
-
PostgresSQL version: postgresql13-server-13.4
-
Go Version go-1.17.1,1
-
gofmt is installed in the default gofmt path, pkg which /usr/local/bin/gofmt /usr/local/bin/gofmt was installed by package go-1.17.1,1
-
Logs:
>> checking code style
gofmt checking failed!
diff -u ./cmd/postgres_exporter/pg_setting_test.go.orig ./cmd/postgres_exporter/pg_setting_test.go
--- ./cmd/postgres_exporter/pg_setting_test.go.orig 2021-10-10 13:50:10.203948000 +0200
+++ ./cmd/postgres_exporter/pg_setting_test.go 2021-10-10 13:50:10.203967000 +0200
@@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+//go:build !integration
// +build !integration
package main
diff -u ./cmd/postgres_exporter/postgres_exporter_integration_test.go.orig ./cmd/postgres_exporter/postgres_exporter_integration_test.go
--- ./cmd/postgres_exporter/postgres_exporter_integration_test.go.orig 2021-10-10 13:50:10.214300000 +0200
+++ ./cmd/postgres_exporter/postgres_exporter_integration_test.go 2021-10-10 13:50:10.214314000 +0200
@@ -14,6 +14,7 @@
// These are specialized integration tests. We only build them when we're doing
// a lot of additional work to keep the external docker environment they require
// working.
+//go:build integration
// +build integration
package main
diff -u ./cmd/postgres_exporter/postgres_exporter_test.go.orig ./cmd/postgres_exporter/postgres_exporter_test.go
--- ./cmd/postgres_exporter/postgres_exporter_test.go.orig 2021-10-10 13:50:10.220428000 +0200
+++ ./cmd/postgres_exporter/postgres_exporter_test.go 2021-10-10 13:50:10.220445000 +0200
@@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+//go:build !integration
// +build !integration
package main
Please ensure you are using go version go1.17.1 freebsd/amd64 for formatting code.
Workaround: Comment out .PHONY : common-style common-style in "Makefile.common"