Skip to content

Conversation

@rifeplight
Copy link

Description

From Go 1.17, the preferred syntax for build constraints is //go:build,
which replaces the old // +build form. The old style is now considered
deprecated but still supported for backward compatibility.

This change removes the obsolete // +build xxx line, keeping only the
modern //go:build xxx directive.

More info: golang/go#41184 and https://go.dev/doc/go1.17#build-lines

Design Doc / Proposal:
https://go.dev/design/draft-gobuild

Rationale

tell us why we need these changes...

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

@buddh0 buddh0 requested a review from Copilot November 28, 2025 05:42
Copilot finished reviewing on behalf of buddh0 November 28, 2025 05:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the build constraint syntax across multiple Go files by removing the deprecated // +build comments while retaining the modern //go:build directives. This aligns with Go 1.17+ conventions where //go:build is the preferred format for build constraints.

Key Changes:

  • Removed legacy // +build comments from 41 Go files across the codebase
  • Retained semantically equivalent //go:build directives
  • All build constraint conversions are correct (AND/OR/NOT logic preserved)

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/fuzzers/bls12381/bls12381_test.go Removed legacy // +build cgo comment
tests/fuzzers/bls12381/bls12381_fuzz.go Removed legacy // +build cgo comment
rpc/ipc_windows.go Removed legacy // +build windows comment
rpc/ipc_wasip1.go Removed legacy // +build wasip1 comment
rpc/ipc_unix.go Removed legacy multi-platform OR build comment
rpc/ipc_js.go Removed legacy // +build js comment
rlp/unsafe.go Removed legacy build comment with AND logic for platform exclusions
rlp/safe.go Removed legacy build comment with OR logic for platform inclusions
p2p/netutil/toobig_windows.go Removed legacy // +build windows comment
p2p/netutil/toobig_notwindows.go Removed legacy // +build !windows comment
metrics/syslog.go Removed legacy // +build !windows comment
metrics/disk_nop.go Removed legacy // +build !linux comment
metrics/cputime_unix.go Removed legacy build comment with platform exclusions
metrics/cputime_nop.go Removed legacy build comment with platform OR logic
metrics/cpu_enabled.go Removed legacy build comment with feature exclusions
metrics/cpu_disabled.go Removed legacy build comment with feature OR logic
ethdb/leveldb/leveldb.go Removed legacy build comment excluding js and wasip1
crypto/signify/signify_fuzz.go Removed legacy // +build gofuzz comment
crypto/signature_nocgo.go Removed legacy build comment with complex platform and feature logic
crypto/signature_cgo.go Removed legacy build comment with complex AND logic
crypto/secp256k1/secp256_test.go Removed legacy build comment for test with cgo
crypto/secp256k1/scalar_mult_nocgo.go Removed legacy build comment for no-cgo fallback
crypto/secp256k1/dummy.go Removed legacy // +build dummy comment
crypto/bn256/cloudflare/gfp_generic.go Removed legacy build comment for generic fallback
crypto/bn256/cloudflare/gfp_decl.go Removed legacy build comment for architecture-specific code
crypto/bn256/bn256_slow.go Removed legacy build comment for architecture exclusions
crypto/bn256/bn256_fast.go Removed legacy build comment for optimized architectures
crypto/blake2b/register.go Removed legacy // +build go1.9 comment
crypto/blake2b/blake2b_ref.go Removed legacy build comment for reference implementation
crypto/blake2b/blake2b_f_fuzz_test.go Removed legacy build comment for AVX-enabled fuzzer
crypto/blake2b/blake2b_amd64.go Removed legacy build comment for amd64 without Go 1.7
crypto/blake2b/blake2bAVX2_amd64.go Removed legacy build comment for AVX2 implementation
core/mkalloc.go Removed legacy // +build none comment
common/fdlimit/fdlimit_unix.go Removed legacy build comment for Unix platforms
common/fdlimit/fdlimit_bsd.go Removed legacy build comment for BSD variants
cmd/utils/diskusage_openbsd.go Removed legacy // +build openbsd comment
cmd/utils/diskusage.go Removed legacy build comment with platform exclusions
accounts/keystore/watch_fallback.go Removed legacy build comment with complex platform combinations
accounts/keystore/watch.go Removed legacy build comment for platform-specific file watching

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@buddh0 buddh0 merged commit 713eb44 into bnb-chain:develop Nov 28, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants