Upgrade net package from Go 1.21.4 to Go 1.26.2

Backport upstream Go standard library changes to TinyGo's net package.

Unmodified files (18) replaced directly from Go 1.26.2 source.
Modified files (22) merged via 3-way diff, preserving all TinyGo
netdev adaptations, TINYGO markers, and embedded-device constraints.

Notable upstream changes included:
- net/http: cookie handling improvements, fs enhancements,
  reverse proxy updates, chunked encoding fixes
- net/http: ServeMux routing and pattern matching updates
- net: IP parsing and MAC address handling improvements
- Various doc link syntax modernization (e.g. [Dial], [Buffers])

TinyGo-only files (netdev.go, tlssock.go) unchanged.
All TINYGO comment markers preserved.
This commit is contained in:
deadprogram
2026-04-13 17:36:35 +02:00
committed by Ron Evans
parent a3417d034f
commit 35e809e0e5
46 changed files with 1580 additions and 779 deletions
+4 -4
View File
@@ -1,4 +1,4 @@
// TINYGO: The following is copied and modified from Go 1.21.4 official implementation.
// TINYGO: The following is copied and modified from Go 1.26.2 official implementation.
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
@@ -30,7 +30,7 @@ var (
type Interface struct {
Index int // positive integer that starts at one, zero is never used
MTU int // maximum transmission unit
Name string // e.g., "en0", "lo0", "eth0.100"
Name string // e.g., "en0", "lo0", "eth0.100"; may be the empty string
HardwareAddr HardwareAddr // IEEE MAC-48, EUI-48 and EUI-64 form
Flags Flags // e.g., FlagUp, FlagLoopback, FlagMulticast
}
@@ -80,7 +80,7 @@ func Interfaces() ([]Interface, error) {
// addresses.
//
// The returned list does not identify the associated interface; use
// Interfaces and Interface.Addrs for more detail.
// Interfaces and [Interface.Addrs] for more detail.
func InterfaceAddrs() ([]Addr, error) {
return nil, errors.New("InterfaceAddrs not implemented")
}
@@ -89,7 +89,7 @@ func InterfaceAddrs() ([]Addr, error) {
//
// On Solaris, it returns one of the logical network interfaces
// sharing the logical data link; for more precision use
// InterfaceByName.
// [InterfaceByName].
func InterfaceByIndex(index int) (*Interface, error) {
return nil, errors.New("InterfaceByIndex not implemented")
}