5 Commits

Author SHA1 Message Date
Vorapol Rinsatitnon
a02b4e43d6 Update go-build.yml 2025-08-26 15:11:19 +07:00
Vorapol Rinsatitnon
c0f79a96a0 Use removeall_noat variant on Windows 2025-08-26 15:07:25 +07:00
Vorapol Rinsatitnon
5ec2836d14 Add binary download links 2025-08-13 23:18:18 +07:00
Vorapol Rinsatitnon
530b016cd0 Update README.md 2025-08-13 23:15:35 +07:00
Vorapol Rinsatitnon
e2770a2ccc Update README.md 2025-08-13 22:50:14 +07:00
7 changed files with 19 additions and 51 deletions

View File

@@ -73,6 +73,7 @@ jobs:
rm -rf src/*.rc
rm -rf src/make.*
rm -rf src/run.*
rm -rf *.md
# Process binaries
cd bin

View File

@@ -10,6 +10,8 @@ _Gopher image by [Renee French][rf], licensed under [Creative Commons 4.0 Attrib
1. **Windows 7 and Windows Server 2008 R2 Support**
While the official Go project has dropped support for Windows 7 and Windows Server 2008 R2, this fork maintains compatibility with these legacy Windows systems.
Tested on Windows7 RTM (build7600) — no updates required — through Windows1124H2
2. **Classic `go get` Behaviour**
This fork allows for the deprecated `go get` behaviour when `GO111MODULE` is set to "off" or "auto". This means:
@@ -37,7 +39,20 @@ The Windows binary provided here also supports Windows 7 and Windows Server 2008
### Binary Distributions
Binary distributions are **available at the [release page](https://github.com/thongtech/go-legacy-win7/releases)**.
| OS | Architecture | Filename | SHA256 Hash |
|----|--------------|----------|--------------|
| **macOS** | Intel (amd64) | [go-legacy-win7-1.25.0-1.darwin_amd64.tar.gz](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.0-1/go-legacy-win7-1.25.0-1.darwin_amd64.tar.gz) | `b5f0946d1c4c686e4569de062f23c015be6fe6d18fea424fb05c27f4ebd412aa` |
| macOS | Apple (ARM64) | [go-legacy-win7-1.25.0-1.darwin_arm64.tar.gz](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.0-1/go-legacy-win7-1.25.0-1.darwin_arm64.tar.gz) | `6888f1e1bb4436f5478abbf609313f242abe3810c2e77b8184a266e5e21fc8dc` |
| **Linux** | x86 (386) | [go-legacy-win7-1.25.0-1.linux_386.tar.gz](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.0-1/go-legacy-win7-1.25.0-1.linux_386.tar.gz) | `00e733607ea4ebb031eb0db12f72ff3e9c082477d5a23de5098cf13449e73090` |
| Linux | x64 (amd64) | [go-legacy-win7-1.25.0-1.linux_amd64.tar.gz](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.0-1/go-legacy-win7-1.25.0-1.linux_amd64.tar.gz) | `9cd208562e00ca0fd4244b59a0e2fb27e332688a21ef45b33a64c297aba33c2f` |
| Linux | ARM (32bit) | [go-legacy-win7-1.25.0-1.linux_arm.tar.gz](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.0-1/go-legacy-win7-1.25.0-1.linux_arm.tar.gz) | `f5367fbfee04259d259d0667bb0caeff5c21c8661e00756c6a399ccbbf00ad0f` |
| Linux | ARM64 | [go-legacy-win7-1.25.0-1.linux_arm64.tar.gz](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.0-1/go-legacy-win7-1.25.0-1.linux_arm64.tar.gz) | `21b38c51be22d5a26769602bf1d0646f3953840313f0c6ab2dd8d622960e1f3e` |
| **Windows** | x86 (386) | [go-legacy-win7-1.25.0-1.windows_386.zip](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.0-1/go-legacy-win7-1.25.0-1.windows_386.zip) | `43c1b46dbaf462a16a7cd33d258fa095e34a7a570299a4f6cf95d2fb511974d8` |
| Windows | x64 (amd64) | [go-legacy-win7-1.25.0-1.windows_amd64.zip](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.0-1/go-legacy-win7-1.25.0-1.windows_amd64.zip) | `cfd5538cd914c393d5fa90d2cb6054a478e588dcb29d86f6442c080310094773` |
| Windows | ARM64 | [go-legacy-win7-1.25.0-1.windows_arm64.zip](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.0-1/go-legacy-win7-1.25.0-1.windows_arm64.zip) | `a998931fa385261f50fc48ab1131a3ed420d5e800dc9022a16944af51282db78` |
### Before you begin
To avoid PATH/GOROOT conflicts and mixed toolchains, uninstall any existing Go installation first.
#### Windows Installation

View File

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build unix || wasip1 || windows
//go:build unix || wasip1
package os

View File

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build (js && wasm) || plan9
//go:build (js && wasm) || plan9 || windows
package os

View File

@@ -189,12 +189,6 @@ func (r *Root) Remove(name string) error {
return rootRemove(r, name)
}
// RemoveAll removes the named file or directory and any children that it contains.
// See [RemoveAll] for more details.
func (r *Root) RemoveAll(name string) error {
return rootRemoveAll(r, name)
}
// Stat returns a [FileInfo] describing the named file in the root.
// See [Stat] for more details.
func (r *Root) Stat(name string) (FileInfo, error) {

View File

@@ -11,7 +11,6 @@ import (
"internal/filepathlite"
"internal/stringslite"
"sync/atomic"
"syscall"
"time"
)
@@ -186,25 +185,6 @@ func rootRemove(r *Root, name string) error {
return nil
}
func rootRemoveAll(r *Root, name string) error {
if endsWithDot(name) {
// Consistency with os.RemoveAll: Return EINVAL when trying to remove .
return &PathError{Op: "RemoveAll", Path: name, Err: syscall.EINVAL}
}
if err := checkPathEscapesLstat(r, name); err != nil {
if err == syscall.ENOTDIR {
// Some intermediate path component is not a directory.
// RemoveAll treats this as success (since the target doesn't exist).
return nil
}
return &PathError{Op: "RemoveAll", Path: name, Err: err}
}
if err := RemoveAll(joinPath(r.root.name, name)); err != nil {
return &PathError{Op: "RemoveAll", Path: name, Err: underlyingError(err)}
}
return nil
}
func rootReadlink(r *Root, name string) (string, error) {
if err := checkPathEscapesLstat(r, name); err != nil {
return "", &PathError{Op: "readlinkat", Path: name, Err: err}

View File

@@ -194,28 +194,6 @@ func rootRemove(r *Root, name string) error {
return nil
}
func rootRemoveAll(r *Root, name string) error {
// Consistency with os.RemoveAll: Strip trailing /s from the name,
// so RemoveAll("not_a_directory/") succeeds.
for len(name) > 0 && IsPathSeparator(name[len(name)-1]) {
name = name[:len(name)-1]
}
if endsWithDot(name) {
// Consistency with os.RemoveAll: Return EINVAL when trying to remove .
return &PathError{Op: "RemoveAll", Path: name, Err: syscall.EINVAL}
}
_, err := doInRoot(r, name, nil, func(parent sysfdType, name string) (struct{}, error) {
return struct{}{}, removeAllFrom(parent, name)
})
if IsNotExist(err) {
return nil
}
if err != nil {
return &PathError{Op: "RemoveAll", Path: name, Err: underlyingError(err)}
}
return err
}
func rootRename(r *Root, oldname, newname string) error {
_, err := doInRoot(r, oldname, nil, func(oldparent sysfdType, oldname string) (struct{}, error) {
_, err := doInRoot(r, newname, nil, func(newparent sysfdType, newname string) (struct{}, error) {