diff --git a/.github/build/friendly-filenames.json b/.github/build/friendly-filenames.json index e6679aedd..b95e9e8c1 100644 --- a/.github/build/friendly-filenames.json +++ b/.github/build/friendly-filenames.json @@ -1,5 +1,6 @@ { "android-arm64": { "friendlyName": "android-arm64-v8a" }, + "android-amd64": { "friendlyName": "android-amd64" }, "darwin-amd64": { "friendlyName": "macos-64" }, "darwin-arm64": { "friendlyName": "macos-arm64-v8a" }, "freebsd-386": { "friendlyName": "freebsd-32" }, @@ -14,9 +15,7 @@ "linux-arm7": { "friendlyName": "linux-arm32-v7a" }, "linux-mips64le": { "friendlyName": "linux-mips64le" }, "linux-mips64": { "friendlyName": "linux-mips64" }, - "linux-mipslesoftfloat": { "friendlyName": "linux-mips32le-softfloat" }, "linux-mipsle": { "friendlyName": "linux-mips32le" }, - "linux-mipssoftfloat": { "friendlyName": "linux-mips32-softfloat" }, "linux-mips": { "friendlyName": "linux-mips32" }, "linux-ppc64le": { "friendlyName": "linux-ppc64le" }, "linux-ppc64": { "friendlyName": "linux-ppc64" }, diff --git a/.github/workflows/release-win7.yml b/.github/workflows/release-win7.yml index 2a641e77f..baa7cc236 100644 --- a/.github/workflows/release-win7.yml +++ b/.github/workflows/release-win7.yml @@ -1,17 +1,14 @@ name: Build and Release for Windows 7 +# Pre-compiling support removal since 1.29 on: workflow_dispatch: release: types: [published] - push: - pull_request: - types: [opened, synchronize, reopened] jobs: check-assets: runs-on: ubuntu-latest - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name steps: - name: Restore Geodat Cache uses: actions/cache/restore@v6 @@ -115,8 +112,6 @@ jobs: COMMID=$(git describe --always --dirty) echo 'Building Xray for Windows 7...' go build -o build_assets/xray.exe -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main - # The line below is for without running conhost.exe version. Commented for not being used. Provided for reference. - # go build -o build_assets/wxray.exe -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-H windowsgui -X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main - name: Restore Geodat Cache uses: actions/cache/restore@v6 @@ -152,6 +147,13 @@ jobs: cp ${GITHUB_WORKSPACE}/README.md ./build_assets/README.md cp ${GITHUB_WORKSPACE}/LICENSE ./build_assets/LICENSE + - name: Upload files to Artifacts + uses: actions/upload-artifact@v7 + with: + name: Xray-${{ env.ASSET_NAME }} + path: | + ./build_assets/* + - name: Create ZIP archive if: github.event_name == 'release' shell: bash @@ -175,10 +177,3 @@ jobs: file: ./Xray-${{ env.ASSET_NAME }}.zip* tag: ${{ github.ref }} file_glob: true - - - name: Upload files to Artifacts - uses: actions/upload-artifact@v7 - with: - name: Xray-${{ env.ASSET_NAME }} - path: | - ./build_assets/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6aba42dc3..24b356c8b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -79,86 +79,23 @@ jobs: contents: write strategy: matrix: - # Include amd64 on all platforms. - goos: [windows, freebsd, openbsd, linux, darwin] - goarch: [amd64, 386] + # Include amd64 and arm64 on all platforms. + goos: [windows, freebsd, openbsd, linux, darwin, android] + goarch: [amd64, arm64] patch-assetname: [""] - exclude: - # Exclude i386 on darwin - - goarch: 386 - goos: darwin include: - # BEGIN MacOS ARM64 - - goos: darwin - goarch: arm64 - # END MacOS ARM64 - # BEGIN Linux ARM 5 6 7 - - goos: linux - goarch: arm - goarm: 7 - - goos: linux - goarch: arm - goarm: 6 - - goos: linux - goarch: arm - goarm: 5 - # END Linux ARM 5 6 7 - # BEGIN Android ARM 8 - - goos: android - goarch: arm64 - # END Android ARM 8 - # BEGIN Android AMD64 - - goos: android - goarch: amd64 - patch-assetname: android-amd64 - # END Android AMD64 - # Windows ARM - - goos: windows - goarch: arm64 - # BEGIN Other architectures - # BEGIN riscv64 & ARM64 & LOONG64 - - goos: linux - goarch: arm64 - - goos: linux - goarch: riscv64 - - goos: linux - goarch: loong64 - # END riscv64 & ARM64 & LOONG64 - # BEGIN MIPS - - goos: linux - goarch: mips64 - - goos: linux - goarch: mips64le - - goos: linux - goarch: mipsle - - goos: linux - goarch: mips - # END MIPS - # BEGIN PPC + # BEGIN Linux specified - goos: linux goarch: ppc64 - goos: linux goarch: ppc64le - # END PPC - # BEGIN FreeBSD ARM - - goos: freebsd - goarch: arm64 - - goos: freebsd - goarch: arm - goarm: 7 - # END FreeBSD ARM - # BEGIN S390X - goos: linux goarch: s390x - # END S390X - # END Other architectures - # BEGIN OPENBSD ARM - - goos: openbsd - goarch: arm64 - - goos: openbsd - goarch: arm - goarm: 7 - # END OPENBSD ARM + - goos: linux + goarch: riscv64 + - goos: linux + goarch: loong64 + # END Linux specified fail-fast: false runs-on: ubuntu-latest @@ -166,7 +103,6 @@ jobs: env: GOOS: ${{ matrix.goos }} GOARCH: ${{ matrix.goarch }} - GOARM: ${{ matrix.goarm }} CGO_ENABLED: 0 steps: - name: Checkout codebase @@ -188,8 +124,8 @@ jobs: - name: Show workflow information run: | _NAME=${{ matrix.patch-assetname }} - [ -n "$_NAME" ] || _NAME=$(jq ".[\"$GOOS-$GOARCH$GOARM$GOMIPS\"].friendlyName" -r < .github/build/friendly-filenames.json) - echo "GOOS: $GOOS, GOARCH: $GOARCH, GOARM: $GOARM, GOMIPS: $GOMIPS, RELEASE_NAME: $_NAME" + [ -n "$_NAME" ] || _NAME=$(jq ".[\"$GOOS-$GOARCH\"].friendlyName" -r < .github/build/friendly-filenames.json) + echo "GOOS: $GOOS, GOARCH: $GOARCH, RELEASE_NAME: $_NAME" echo "ASSET_NAME=$_NAME" >> $GITHUB_ENV - name: Set up Go @@ -203,6 +139,18 @@ jobs: - name: Build Xray run: | + case "${GOARCH}:${GOOS}" in + # Special processing for x86-64 and ARM64 + amd64:windows|amd64:darwin) + GOAMD64="v2" + ;; + arm64:windows) + GOARM64="v8.2" + ;; + arm64:darwin) + GOARM64="v8.4" + ;; + esac mkdir -p build_assets COMMID=$(git describe --always --dirty) if [[ ${GOOS} == 'windows' ]]; then @@ -215,13 +163,7 @@ jobs: go build -o build_assets/xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid= -checklinkname=0 -extldflags=-Wl,--pack-dyn-relocs=android" -v ./main else echo 'Building Xray...' - if [[ ${GOARCH} == 'mips' || ${GOARCH} == 'mipsle' ]]; then - go build -o build_assets/xray -trimpath -buildvcs=false -gcflags="-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main - echo 'Building soft-float Xray for MIPS/MIPSLE 32-bit...' - GOMIPS=softfloat go build -o build_assets/xray_softfloat -trimpath -buildvcs=false -gcflags="-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main - else - go build -o build_assets/xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main - fi + go build -o build_assets/xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main fi - name: Restore Geodat Cache @@ -248,9 +190,6 @@ jobs: if [[ ${GOARCH} == 'amd64' ]]; then mv resources/wintun/bin/amd64/wintun.dll build_assets/ fi - if [[ ${GOARCH} == '386' ]]; then - mv resources/wintun/bin/x86/wintun.dll build_assets/ - fi if [[ ${GOARCH} == 'arm64' ]]; then mv resources/wintun/bin/arm64/wintun.dll build_assets/ fi @@ -262,6 +201,13 @@ jobs: cp ${GITHUB_WORKSPACE}/README.md ./build_assets/README.md cp ${GITHUB_WORKSPACE}/LICENSE ./build_assets/LICENSE + - name: Upload files to Artifacts + uses: actions/upload-artifact@v7 + with: + name: Xray-${{ env.ASSET_NAME }} + path: | + ./build_assets/* + - name: Create ZIP archive if: github.event_name == 'release' shell: bash @@ -286,9 +232,156 @@ jobs: tag: ${{ github.ref }} file_glob: true + build-release-only: + needs: check-assets + permissions: + contents: write + strategy: + matrix: + # First batch (since Go 1.29) of removal: + # x86: windows, linux, freebsd, openbsd + # arm: linux(v5), linux(v6) + # other: linux(mips), linux(mips64), linux(mips64le) + # Second batch (needs discussion) of removal + # arm(v7): freebsd, openbsd, linux + # other: linux(mipsle) + goos: [windows, freebsd, openbsd, linux] + goarch: [arm, 386] + goarm: [7] + exclude: + - goos: windows + goarch: arm + include: + # Second batch of removal [In the future] + - goos: linux + goarch: mipsle + # END of second batch + # First batch of removal [Go 1.29] + - goos: linux + goarch: arm + goarm: 5 + - goos: linux + goarch: arm + goarm: 6 + - goos: linux + goarch: mips + - goos: linux + goarch: mips64 + - goos: linux + goarch: mips64le + # END of first batch + fail-fast: false + + runs-on: ubuntu-latest + if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' + env: + GOOS: ${{ matrix.goos }} + GOARCH: ${{ matrix.goarch }} + GOARM: ${{ matrix.goarm }} + CGO_ENABLED: 0 + steps: + - name: Checkout codebase + uses: actions/checkout@v7 + + - name: Show workflow information + run: | + _NAME=${{ matrix.patch-assetname }} + if [[ ${GOARCH} == 'arm' ]]; then + [ -n "$_NAME" ] || _NAME=$(jq ".[\"$GOOS-$GOARCH$GOARM\"].friendlyName" -r < .github/build/friendly-filenames.json) + echo "GOOS: $GOOS, GOARCH: $GOARCH, GOARM: $GOARM, RELEASE_NAME: $_NAME" + else + echo "GOARM=''" >> $GITHUB_ENV + [ -n "$_NAME" ] || _NAME=$(jq ".[\"$GOOS-$GOARCH\"].friendlyName" -r < .github/build/friendly-filenames.json) + echo "GOOS: $GOOS, GOARCH: $GOARCH, RELEASE_NAME: $_NAME" + fi + echo "ASSET_NAME=$_NAME" >> $GITHUB_ENV + + - name: Set up Go + uses: actions/setup-go@v7 + with: + go-version-file: go.mod + check-latest: true + + - name: Get project dependencies + run: go mod download + + - name: Build Xray + run: | + mkdir -p build_assets + COMMID=$(git describe --always --dirty) + if [[ ${GOOS} == 'windows' ]]; then + echo 'Building Xray for Windows...' + go build -o build_assets/xray.exe -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main + else + echo 'Building Xray...' + if [[ ${GOARCH} == 'mips' || ${GOARCH} == 'mipsle' ]]; then + go build -o build_assets/xray -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main + echo 'Building soft-float Xray for MIPS/MIPSLE 32-bit...' + GOMIPS=softfloat go build -o build_assets/xray_softfloat -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main + else + go build -o build_assets/xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main + fi + fi + + - name: Restore Geodat Cache + uses: actions/cache/restore@v6 + with: + path: resources + key: xray-geodat- + + - name: Restore Wintun Cache + if: matrix.goos == 'windows' + uses: actions/cache/restore@v6 + with: + path: resources + key: xray-wintun- + + - name: Add additional assets into package + run: | + mv -f resources/geo* build_assets/ + if [[ ${GOOS} == 'windows' ]]; then + cp .github/build/windows/* build_assets/ + fi + if [[ ${GOOS} == 'windows' ]]; then + echo 'Adding Wintun into packages' + if [[ ${GOARCH} == '386' ]]; then + mv resources/wintun/bin/x86/wintun.dll build_assets/ + fi + mv resources/wintun/LICENSE.txt build_assets/LICENSE-Wintun + fi + + - name: Copy README.md & LICENSE + run: | + cp ${GITHUB_WORKSPACE}/README.md ./build_assets/README.md + cp ${GITHUB_WORKSPACE}/LICENSE ./build_assets/LICENSE + - name: Upload files to Artifacts uses: actions/upload-artifact@v7 with: name: Xray-${{ env.ASSET_NAME }} path: | ./build_assets/* + + - name: Create ZIP archive + if: github.event_name == 'release' + shell: bash + run: | + pushd build_assets || exit 1 + touch -mt $(date +%Y01010000) * + zip -9vr ../Xray-${{ env.ASSET_NAME }}.zip . + popd || exit 1 + FILE=./Xray-${{ env.ASSET_NAME }}.zip + DGST=$FILE.dgst + for METHOD in {"md5","sha1","sha256","sha512"} + do + openssl dgst -$METHOD $FILE | sed 's/([^)]*)//g' >>$DGST + done + + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 + if: github.event_name == 'release' + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./Xray-${{ env.ASSET_NAME }}.zip* + tag: ${{ github.ref }} + file_glob: true diff --git a/README.md b/README.md index e1436751a..688160661 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,20 @@ Make sure that you are using the same Go version, and remember to set the git co CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main ``` +For Windows (x86-64 and AArch64, not win7): + +```bash +GOOS=windows GOARCH=amd64 GOAMD64=v2 CGO_ENABLED=0 go build -o xray.exe -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main +GOOS=windows GOARCH=arm64 GOARM64=v8.2 CGO_ENABLED=0 go build -o xray.exe -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main +``` + +For macOS: + +```bash +GOOS=darwin GOARCH=amd64 GOAMD64=v2 CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main +GOOS=darwin GOARCH=arm64 GOARM64=v8.4 CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main +``` + For Android: ```bash @@ -238,10 +252,13 @@ GOOS=android GOARCH=arm64 CGO_ENABLED=1 CC=/path/to/aarch64-linux-android24-clan GOOS=android GOARCH=amd64 CGO_ENABLED=1 CC=/path/to/x86_64-linux-android24-clang go build -o xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid= -checklinkname=0 -extldflags=-Wl,--pack-dyn-relocs=android" -v ./main ``` -If you are compiling a 32-bit MIPS/MIPSLE target, use this command instead: +For Linux (MIPS32 and MIPS32LE): ```bash -CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -gcflags="-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main +GOOS=linux GOARCH=mips GOMIPS=hardfloat CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main +GOOS=linux GOARCH=mips GOMIPS=softfloat CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main +GOOS=linux GOARCH=mipsle GOMIPS=hardfloat CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main +GOOS=linux GOARCH=mipsle GOMIPS=softfloat CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main ``` ## Stargazers over time diff --git a/common/buf/readv_posix.go b/common/buf/readv_posix.go index 860030edc..5d612d3dc 100644 --- a/common/buf/readv_posix.go +++ b/common/buf/readv_posix.go @@ -1,5 +1,4 @@ -//go:build !windows && !wasm && !illumos && !openbsd -// +build !windows,!wasm,!illumos,!openbsd +//go:build !windows && !openbsd package buf diff --git a/common/buf/readv_reader.go b/common/buf/readv_reader.go index 6ce44623e..0cc64e6fa 100644 --- a/common/buf/readv_reader.go +++ b/common/buf/readv_reader.go @@ -1,5 +1,4 @@ -//go:build !wasm && !openbsd -// +build !wasm,!openbsd +//go:build !openbsd package buf diff --git a/common/buf/readv_reader_stub.go b/common/buf/readv_reader_stub.go index fcb6154f6..5a8178e44 100644 --- a/common/buf/readv_reader_stub.go +++ b/common/buf/readv_reader_stub.go @@ -1,5 +1,4 @@ -//go:build wasm || openbsd -// +build wasm openbsd +//go:build openbsd package buf diff --git a/common/buf/readv_test.go b/common/buf/readv_test.go index 6df4c4e8f..79be7fbde 100644 --- a/common/buf/readv_test.go +++ b/common/buf/readv_test.go @@ -1,5 +1,4 @@ -//go:build !wasm && !openbsd -// +build !wasm,!openbsd +//go:build !openbsd package buf_test diff --git a/common/buf/readv_unix.go b/common/buf/readv_unix.go deleted file mode 100644 index f5ac6ad1e..000000000 --- a/common/buf/readv_unix.go +++ /dev/null @@ -1,37 +0,0 @@ -//go:build illumos -// +build illumos - -package buf - -import "golang.org/x/sys/unix" - -type unixReader struct { - iovs [][]byte -} - -func (r *unixReader) Init(bs []*Buffer) { - iovs := r.iovs - if iovs == nil { - iovs = make([][]byte, 0, len(bs)) - } - for _, b := range bs { - iovs = append(iovs, b.v) - } - r.iovs = iovs -} - -func (r *unixReader) Read(fd uintptr) int32 { - n, e := unix.Readv(int(fd), r.iovs) - if e != nil { - return -1 - } - return int32(n) -} - -func (r *unixReader) Clear() { - r.iovs = r.iovs[:0] -} - -func newMultiReader() multiReader { - return &unixReader{} -} diff --git a/common/crypto/internal/chacha_core_gen.go b/common/crypto/internal/chacha_core_gen.go index 5a285172d..b2c1769fa 100644 --- a/common/crypto/internal/chacha_core_gen.go +++ b/common/crypto/internal/chacha_core_gen.go @@ -1,5 +1,4 @@ //go:build generate -// +build generate package main diff --git a/common/platform/others.go b/common/platform/others.go index f3e491d62..dd2716677 100644 --- a/common/platform/others.go +++ b/common/platform/others.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows package platform diff --git a/common/platform/windows.go b/common/platform/windows.go index b6554b4b7..2da81d1bd 100644 --- a/common/platform/windows.go +++ b/common/platform/windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package platform diff --git a/main/main_test.go b/main/main_test.go index e873c7b34..1e7cc1b24 100644 --- a/main/main_test.go +++ b/main/main_test.go @@ -1,5 +1,4 @@ //go:build coveragemain -// +build coveragemain package main diff --git a/proxy/dokodemo/fakeudp_linux.go b/proxy/dokodemo/fakeudp_linux.go index 6915349f2..a889372b5 100644 --- a/proxy/dokodemo/fakeudp_linux.go +++ b/proxy/dokodemo/fakeudp_linux.go @@ -1,5 +1,4 @@ //go:build linux -// +build linux package dokodemo diff --git a/proxy/dokodemo/fakeudp_openbsd.go b/proxy/dokodemo/fakeudp_openbsd.go index 7f714e4b6..12d41208d 100644 --- a/proxy/dokodemo/fakeudp_openbsd.go +++ b/proxy/dokodemo/fakeudp_openbsd.go @@ -1,5 +1,4 @@ //go:build openbsd -// +build openbsd package dokodemo diff --git a/proxy/dokodemo/fakeudp_other.go b/proxy/dokodemo/fakeudp_other.go index 353617937..08dd9fe82 100644 --- a/proxy/dokodemo/fakeudp_other.go +++ b/proxy/dokodemo/fakeudp_other.go @@ -1,5 +1,4 @@ //go:build !linux && !openbsd -// +build !linux,!openbsd package dokodemo diff --git a/testing/scenarios/common_coverage.go b/testing/scenarios/common_coverage.go index 160df47c0..7b984358a 100644 --- a/testing/scenarios/common_coverage.go +++ b/testing/scenarios/common_coverage.go @@ -1,5 +1,4 @@ //go:build coverage -// +build coverage package scenarios diff --git a/testing/scenarios/common_regular.go b/testing/scenarios/common_regular.go index 19efc7135..170755e6c 100644 --- a/testing/scenarios/common_regular.go +++ b/testing/scenarios/common_regular.go @@ -1,5 +1,4 @@ //go:build !coverage -// +build !coverage package scenarios diff --git a/transport/internet/filelocker_other.go b/transport/internet/filelocker_other.go index 36d937c13..f3f18adaa 100644 --- a/transport/internet/filelocker_other.go +++ b/transport/internet/filelocker_other.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows package internet diff --git a/transport/internet/finalmask/mkcp/original/xor.go b/transport/internet/finalmask/mkcp/original/xor.go index b2a061796..dfa172e51 100644 --- a/transport/internet/finalmask/mkcp/original/xor.go +++ b/transport/internet/finalmask/mkcp/original/xor.go @@ -1,5 +1,4 @@ //go:build !amd64 -// +build !amd64 package original diff --git a/transport/internet/sockopt_openbsd.go b/transport/internet/sockopt_openbsd.go index 1efa56674..38c3e760d 100644 --- a/transport/internet/sockopt_openbsd.go +++ b/transport/internet/sockopt_openbsd.go @@ -1,5 +1,4 @@ //go:build openbsd -// +build openbsd package internet diff --git a/transport/internet/sockopt_other.go b/transport/internet/sockopt_other.go index 3bcdf51d5..b437144ed 100644 --- a/transport/internet/sockopt_other.go +++ b/transport/internet/sockopt_other.go @@ -1,5 +1,4 @@ -//go:build js || netbsd || solaris -// +build js netbsd solaris +//go:build !windows && !darwin && !linux && !freebsd && !openbsd package internet diff --git a/transport/internet/tcp/sockopt_darwin.go b/transport/internet/tcp/sockopt_darwin.go index ec0da29a8..3be60da77 100644 --- a/transport/internet/tcp/sockopt_darwin.go +++ b/transport/internet/tcp/sockopt_darwin.go @@ -1,5 +1,4 @@ //go:build darwin -// +build darwin package tcp diff --git a/transport/internet/tcp/sockopt_freebsd.go b/transport/internet/tcp/sockopt_freebsd.go index d7ab3ff01..f57eb942f 100644 --- a/transport/internet/tcp/sockopt_freebsd.go +++ b/transport/internet/tcp/sockopt_freebsd.go @@ -1,5 +1,4 @@ //go:build freebsd -// +build freebsd package tcp diff --git a/transport/internet/tcp/sockopt_linux.go b/transport/internet/tcp/sockopt_linux.go index f5648e8fc..8478c1267 100644 --- a/transport/internet/tcp/sockopt_linux.go +++ b/transport/internet/tcp/sockopt_linux.go @@ -1,5 +1,4 @@ //go:build linux -// +build linux package tcp diff --git a/transport/internet/tcp/sockopt_linux_test.go b/transport/internet/tcp/sockopt_linux_test.go index 8210cb4be..f951beaa2 100644 --- a/transport/internet/tcp/sockopt_linux_test.go +++ b/transport/internet/tcp/sockopt_linux_test.go @@ -1,5 +1,4 @@ //go:build linux -// +build linux package tcp_test diff --git a/transport/internet/tcp/sockopt_other.go b/transport/internet/tcp/sockopt_other.go index 3f657354a..69f079c10 100644 --- a/transport/internet/tcp/sockopt_other.go +++ b/transport/internet/tcp/sockopt_other.go @@ -1,5 +1,4 @@ //go:build !linux && !freebsd && !darwin -// +build !linux,!freebsd,!darwin package tcp diff --git a/transport/internet/tls/config_other.go b/transport/internet/tls/config_other.go index 985c56c9c..8815323d3 100644 --- a/transport/internet/tls/config_other.go +++ b/transport/internet/tls/config_other.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows package tls diff --git a/transport/internet/tls/config_windows.go b/transport/internet/tls/config_windows.go index 2ae586f45..4afc6d3dd 100644 --- a/transport/internet/tls/config_windows.go +++ b/transport/internet/tls/config_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package tls diff --git a/transport/internet/udp/hub_darwin.go b/transport/internet/udp/hub_darwin.go index fa965b3cf..2ea0a1b94 100644 --- a/transport/internet/udp/hub_darwin.go +++ b/transport/internet/udp/hub_darwin.go @@ -1,5 +1,4 @@ //go:build darwin -// +build darwin package udp diff --git a/transport/internet/udp/hub_freebsd.go b/transport/internet/udp/hub_freebsd.go index 6bf9fd872..f57130592 100644 --- a/transport/internet/udp/hub_freebsd.go +++ b/transport/internet/udp/hub_freebsd.go @@ -1,5 +1,4 @@ //go:build freebsd -// +build freebsd package udp diff --git a/transport/internet/udp/hub_linux.go b/transport/internet/udp/hub_linux.go index 07dc472eb..6eacc00ac 100644 --- a/transport/internet/udp/hub_linux.go +++ b/transport/internet/udp/hub_linux.go @@ -1,5 +1,4 @@ //go:build linux -// +build linux package udp diff --git a/transport/internet/udp/hub_openbsd.go b/transport/internet/udp/hub_openbsd.go index 04c465a9d..b1d8ba241 100644 --- a/transport/internet/udp/hub_openbsd.go +++ b/transport/internet/udp/hub_openbsd.go @@ -1,5 +1,4 @@ //go:build openbsd -// +build openbsd package udp diff --git a/transport/internet/udp/hub_openbsd_test.go b/transport/internet/udp/hub_openbsd_test.go index a5c3e250e..1619d9e91 100644 --- a/transport/internet/udp/hub_openbsd_test.go +++ b/transport/internet/udp/hub_openbsd_test.go @@ -1,5 +1,4 @@ //go:build openbsd -// +build openbsd package udp diff --git a/transport/internet/udp/hub_other.go b/transport/internet/udp/hub_other.go index f85da08b5..19e12a52d 100644 --- a/transport/internet/udp/hub_other.go +++ b/transport/internet/udp/hub_other.go @@ -1,5 +1,4 @@ //go:build !linux && !freebsd && !darwin && !openbsd -// +build !linux,!freebsd,!darwin,!openbsd package udp