diff --git a/Makefile b/Makefile index 3f5cd84..a2cb5af 100644 --- a/Makefile +++ b/Makefile @@ -13,72 +13,72 @@ check: ## Check BUILD_FAIL_PATTERN=grep -v "exec format error" | grep "build failed" && exit 1 || exit 0 build_test: ## test only buildable # Supported operating systems - GOOS=linux GOARCH=amd64 go test ./... | $(BUILD_FAIL_PATTERN) - GOOS=linux GOARCH=386 go test ./... | $(BUILD_FAIL_PATTERN) - GOOS=linux GOARCH=arm go test ./... | $(BUILD_FAIL_PATTERN) - GOOS=linux GOARCH=arm64 go test ./... | $(BUILD_FAIL_PATTERN) - GOOS=linux GOARCH=loong64 go test ./... | $(BUILD_FAIL_PATTERN) - GOOS=linux GOARCH=riscv64 go test ./... | $(BUILD_FAIL_PATTERN) - GOOS=linux GOARCH=s390x go test ./... | $(BUILD_FAIL_PATTERN) - GOOS=freebsd GOARCH=amd64 go test ./... | $(BUILD_FAIL_PATTERN) - GOOS=freebsd GOARCH=386 go test ./... | $(BUILD_FAIL_PATTERN) - GOOS=freebsd GOARCH=arm go test ./... | $(BUILD_FAIL_PATTERN) - GOOS=freebsd GOARCH=arm64 go test ./... | $(BUILD_FAIL_PATTERN) - CGO_ENABLED=0 GOOS=darwin go test ./... | $(BUILD_FAIL_PATTERN) - GOOS=windows go test ./... | $(BUILD_FAIL_PATTERN) + GOOS=linux GOARCH=amd64 go120 test ./... | $(BUILD_FAIL_PATTERN) + GOOS=linux GOARCH=386 go120 test ./... | $(BUILD_FAIL_PATTERN) + GOOS=linux GOARCH=arm go120 test ./... | $(BUILD_FAIL_PATTERN) + GOOS=linux GOARCH=arm64 go120 test ./... | $(BUILD_FAIL_PATTERN) + GOOS=linux GOARCH=loong64 go120 test ./... | $(BUILD_FAIL_PATTERN) + GOOS=linux GOARCH=riscv64 go120 test ./... | $(BUILD_FAIL_PATTERN) + GOOS=linux GOARCH=s390x go120 test ./... | $(BUILD_FAIL_PATTERN) + GOOS=freebsd GOARCH=amd64 go120 test ./... | $(BUILD_FAIL_PATTERN) + GOOS=freebsd GOARCH=386 go120 test ./... | $(BUILD_FAIL_PATTERN) + GOOS=freebsd GOARCH=arm go120 test ./... | $(BUILD_FAIL_PATTERN) + GOOS=freebsd GOARCH=arm64 go120 test ./... | $(BUILD_FAIL_PATTERN) + CGO_ENABLED=0 GOOS=darwin go120 test ./... | $(BUILD_FAIL_PATTERN) + GOOS=windows go120 test ./... | $(BUILD_FAIL_PATTERN) # Operating systems supported for building only (not implemented error if used) - GOOS=solaris go test ./... | $(BUILD_FAIL_PATTERN) - GOOS=dragonfly go test ./... | $(BUILD_FAIL_PATTERN) - GOOS=netbsd go test ./... | $(BUILD_FAIL_PATTERN) + GOOS=solaris go120 test ./... | $(BUILD_FAIL_PATTERN) + GOOS=dragonfly go120 test ./... | $(BUILD_FAIL_PATTERN) + GOOS=netbsd go120 test ./... | $(BUILD_FAIL_PATTERN) # cross build to OpenBSD not worked since process has "C" -# GOOS=openbsd go test ./... | $(BUILD_FAIL_PATTERN) - GOOS=plan9 go test ./... | $(BUILD_FAIL_PATTERN) +# GOOS=openbsd go120 test ./... | $(BUILD_FAIL_PATTERN) + GOOS=plan9 go120 test ./... | $(BUILD_FAIL_PATTERN) ifeq ($(shell uname -s), Darwin) - CGO_ENABLED=1 GOOS=darwin go test ./... | $(BUILD_FAIL_PATTERN) + CGO_ENABLED=1 GOOS=darwin go120 test ./... | $(BUILD_FAIL_PATTERN) endif @echo 'Successfully built on all known operating systems' vet: - GOOS=darwin GOARCH=amd64 go vet ./... - GOOS=darwin GOARCH=arm64 go vet ./... + GOOS=darwin GOARCH=amd64 go120 vet ./... + GOOS=darwin GOARCH=arm64 go120 vet ./... - GOOS=dragonfly GOARCH=amd64 go vet ./... + GOOS=dragonfly GOARCH=amd64 go120 vet ./... - GOOS=freebsd GOARCH=amd64 go vet ./... - GOOS=freebsd GOARCH=386 go vet ./... - GOOS=freebsd GOARCH=arm go vet ./... + GOOS=freebsd GOARCH=amd64 go120 vet ./... + GOOS=freebsd GOARCH=386 go120 vet ./... + GOOS=freebsd GOARCH=arm go120 vet ./... - GOOS=linux GOARCH=386 go vet ./... - GOOS=linux GOARCH=amd64 go vet ./... - GOOS=linux GOARCH=arm64 go vet ./... - GOOS=linux GOARCH=arm go vet ./... - GOOS=linux GOARCH=loong64 go vet ./... - GOOS=linux GOARCH=mips64 go vet ./... - GOOS=linux GOARCH=mips64le go vet ./... - GOOS=linux GOARCH=mips go vet ./... - GOOS=linux GOARCH=mipsle go vet ./... - GOOS=linux GOARCH=ppc64le go vet ./... - GOOS=linux GOARCH=ppc64 go vet ./... - GOOS=linux GOARCH=riscv64 go vet ./... - GOOS=linux GOARCH=s390x go vet ./... + GOOS=linux GOARCH=386 go120 vet ./... + GOOS=linux GOARCH=amd64 go120 vet ./... + GOOS=linux GOARCH=arm64 go120 vet ./... + GOOS=linux GOARCH=arm go120 vet ./... + GOOS=linux GOARCH=loong64 go120 vet ./... + GOOS=linux GOARCH=mips64 go120 vet ./... + GOOS=linux GOARCH=mips64le go120 vet ./... + GOOS=linux GOARCH=mips go120 vet ./... + GOOS=linux GOARCH=mipsle go120 vet ./... + GOOS=linux GOARCH=ppc64le go120 vet ./... + GOOS=linux GOARCH=ppc64 go120 vet ./... + GOOS=linux GOARCH=riscv64 go120 vet ./... + GOOS=linux GOARCH=s390x go120 vet ./... - GOOS=netbsd GOARCH=amd64 go vet ./... + GOOS=netbsd GOARCH=amd64 go120 vet ./... - GOOS=openbsd GOARCH=386 go vet ./... - GOOS=openbsd GOARCH=amd64 go vet ./... + GOOS=openbsd GOARCH=386 go120 vet ./... + GOOS=openbsd GOARCH=amd64 go120 vet ./... - GOOS=solaris GOARCH=amd64 go vet ./... + GOOS=solaris GOARCH=amd64 go120 vet ./... - GOOS=windows GOARCH=amd64 go vet ./... - GOOS=windows GOARCH=386 go vet ./... + GOOS=windows GOARCH=amd64 go120 vet ./... + GOOS=windows GOARCH=386 go120 vet ./... - GOOS=plan9 GOARCH=amd64 go vet ./... - GOOS=plan9 GOARCH=386 go vet ./... + GOOS=plan9 GOARCH=amd64 go120 vet ./... + GOOS=plan9 GOARCH=386 go120 vet ./... macos_test: - CGO_ENABLED=0 GOOS=darwin go test ./... | $(BUILD_FAIL_PATTERN) - CGO_ENABLED=1 GOOS=darwin go test ./... | $(BUILD_FAIL_PATTERN) + CGO_ENABLED=0 GOOS=darwin go120 test ./... | $(BUILD_FAIL_PATTERN) + CGO_ENABLED=1 GOOS=darwin go120 test ./... | $(BUILD_FAIL_PATTERN) init_tools: go get github.com/golang/dep/cmd/dep diff --git a/cpu/cpu_netbsd_amd64.go b/cpu/cpu_netbsd_amd64.go new file mode 100644 index 0000000..57e1452 --- /dev/null +++ b/cpu/cpu_netbsd_amd64.go @@ -0,0 +1,9 @@ +package cpu + +type cpuTimes struct { + User uint64 + Nice uint64 + Sys uint64 + Intr uint64 + Idle uint64 +} diff --git a/disk/disk_netbsd_amd64.go b/disk/disk_netbsd_amd64.go new file mode 100644 index 0000000..c21421c --- /dev/null +++ b/disk/disk_netbsd_amd64.go @@ -0,0 +1,45 @@ +//go:build netbsd && amd64 +// +build netbsd,amd64 + +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs types_netbsd.go + +package disk + +const ( + sizeOfStatvfs = 0xce0 +) + +type ( + Statvfs struct { + Flag uint64 + Bsize uint64 + Frsize uint64 + Iosize uint64 + Blocks uint64 + Bfree uint64 + Bavail uint64 + Bresvd uint64 + Files uint64 + Ffree uint64 + Favail uint64 + Fresvd uint64 + Syncreads uint64 + Syncwrites uint64 + Asyncreads uint64 + Asyncwrites uint64 + Fsidx _Ctype_struct___0 + Fsid uint64 + Namemax uint64 + Owner uint32 + Spare [4]uint64 + Fstypename [32]uint8 + Mntonname [1024]uint8 + Mntfromname [1024]uint8 + Mntfromlabel [1024]uint8 + } +) + +type _Ctype_struct___0 struct { + FsidVal [2]int32 +} diff --git a/mem/mem_bsd.go b/mem/mem_bsd.go index ce930fb..ef867d7 100644 --- a/mem/mem_bsd.go +++ b/mem/mem_bsd.go @@ -1,5 +1,5 @@ -//go:build freebsd || openbsd -// +build freebsd openbsd +//go:build freebsd || openbsd || netbsd +// +build freebsd openbsd netbsd package mem