go2cs 1.26.11.2: the full release notes

go2cs

Full text of the December XX, 2026 announcement, condensed in the go2cs News Archive.


What changed

Converting and testing modules

The go2cs tool

Known issues

Documentation

Upgrading from an earlier release

Every change since 1.26.11.1, merge by merge

The announcement groups the changes by what a Go developer would notice. This section lists each one, under the same groups, with the merge on the master branch that brought it. The sections above carry the full text of the changes the announcement names.

Package initialization

Merge Change
884cffe787 A package outside the standard library initializes as Go does: package main’s entry point initializes every package of the program in Go’s order before main, where 1.26.11.1 initialized a package when .NET first touched it. Init frames are named main.init.0 and so on, as Go names them.
9227361baa A package variable whose initializer starts a goroutine, directly or by handing a function to another package or to a standard-library function that runs it on a goroutine, and waits for it, no longer hangs.

Deadlocks and Go’s fatal errors

Merge Change
343c922b00 When every goroutine is blocked on a channel, select, sync.WaitGroup, sync.Cond or sync.RWMutex, the program prints fatal error: all goroutines are asleep - deadlock! with its goroutines and exits 2, where it hung. GO2CS_DEADLOCK=0 turns the check off.
7bc52c8373 Concurrent map writes end with Go’s fatal error: concurrent map writes; an unrecovered panic of a struct, pointer, slice, map, array or channel prints Go’s (T) 0x…; a panic value whose Error or String panics prints Go’s fatal error; array == follows Go (a NaN element is unequal; an uncomparable interface element panics); a map key holding an unhashable value panics with Go’s message.
0a7d4ed97e A sync.WaitGroup reused before the previous Wait returned panics with Go’s message, where it slept through.

Silent wrong results, now Go’s

Merge Change
6399fea4b1 An array, or a struct holding one, is copied at every site Go copies it: a type assertion, a for-clause variable’s per-iteration copy, an explicit interface conversion, a deferred or spawned receiver. Several shared storage.
61df87eb64 In generic code instantiated with an array, binding, storing, sending, ranging over or returning a T copies the array, where it shared the caller’s.
b66bcf50cf Slicing a value whose type parameter has an array core shares the array’s storage, as Go does.
1771cb83a8 A keyed struct literal that leaves out an embedded struct holding an array builds the embed at Go’s zero value.
7f7bc336c3 unique.Make over an unnamed array type argument gets a descriptor of the right size.
8ae0d5d146 The address of a field whose path crosses a pointer (&r.e.f through an embedded *E, &m[k].f.g, &p.q.f) is the real field’s; writes through it, and pointer methods called through the chain, were lost on a copy.
e3163c185d &(*r).c and the value-field chains of a named pointer type (type PS *St) address the real field, and a field promoted through an embedded pointer to another package’s struct is addressed through that pointer once, as in Go.
30b190a358 An immediately invoked function literal given the enclosing function’s pointer parameter or receiver receives the pointer; an interface parameter there held the struct value.
b584a43382 A nil value of a named pointer type stored in an any is Go’s typed nil.
a6947b36fe A call whose results spread into interface parameters converts each result as a direct argument does: a nil *T spread into any is no longer Go’s nil interface.
39599814ac In generic code with an erased pointer type parameter, a P value converted to an interface holds the pointer.
6de84c454b An untyped constant shifted by a variable count into a named integer type gives Go’s result.
006feaabc4 A named untyped integer constant above MaxInt64 computes arithmetic, bit operations and shifts on Go’s value.
85690ecb86 A float constant expression evaluates to Go’s exact value; an untyped complex constant prints as Go prints it; complex128 division follows Go’s algorithm.
5413fa5be4 A named untyped float constant converted to float32 rounds once, as Go does; two imported packages with the same name, in different files of one package, bind the right package.
dd71b563dd An untyped constant expression typed as a type parameter whose set holds floats, or ints and floats, is folded exactly, where C# integer arithmetic could overflow.
51dfd72b8f A file whose Go version is before go1.22 gets one loop variable per loop, as that Go did; in a go1.22 file a loop variable written after a closure captured it, in the same iteration, is the closure’s too.
f91b32e4c7 A captured for-clause loop variable that the body changes through a pointer method or a field is copied back.
74782d1fa5, e806c6fa90 A shadowed variable used as an assignment target in a select receive, a range assignment, a parenthesized target or through a slice expression binds the inner variable, where it bound the outer one.
19bfc20cb9 var a, b T = pair() assigns both results.
9afa29f4c0, bb31450268, 5ae4731ec9 A closure, deferred or spawned call of a pointer method deep in a captured struct, or on a parenthesized operand, works on the variable, not on a copy.
5829e77d01, b8e4447714 A go or defer whose callee is a variable, a field, an element, a map entry, a dereference or a call reads the function at the statement, as Go does.
7bdefdd720 f(xs...) hands the callee the caller’s slice, so cap in the callee is Go’s.
4a56f17a3a Another package’s unexported interface method met through a struct embed is refused by name, GO2CS2016, where a call could reach the wrong method.

Go’s order of evaluation

Merge Change
6ac2b1d71f Where a call in a statement can change a variable read to its left, the statement’s calls run first and the plain operands are read after them, as Go’s compiler does.
10de31bba7 A call whose results spread into another call runs in Go’s order: calls written to its left first, inside && and || only when reached; it now converts in switch tags, type-switch guards and go and defer arguments.
56dfefdb8b A method value is evaluated in Go’s order with the calls around it, and a deferred or spawned promoted method copies its receiver’s arrays.

Generic code

Merge Change
bcc8d85081 The pointer-method constraint idiom (func F[T any, PT interface{ *T; M() }]) converts and runs; four uses are refused by name.
dc23d64667 Constraints built from named terms (interface{ Integer | Float }) are read through those terms; numeric conversions into named numeric types compile; GO2CS2018 refuses a constant compared with a complex-admitting type parameter, which would have answered false.
d736e32520, e278c8ca71 A ~string constraint, also beside a method, compiles and runs; min and max of three or more values compile.
a92536875c A type parameter constrained to a channel type converts: send, receive, close, range, len, cap, make and nil comparison.
e24bf2bb49 A union constraint holding bool compiles.
3036fb7bb4 A constraint mixing type terms and methods compiles.
fcd7945088 A type-parameter value converted to an interface its constraint does not embed compiles and works.
dc8e5a33b1 A type assertion to an instantiated generic interface answers by method set, also under Native AOT.
4f1c748952 case T: in a type switch matches by method set; T.String method expressions and float conversions of numeric type parameters compile.
f22961960c The zero value of a type parameter whose type argument is an unnamed array panics by name where it built a length-0 array, and GO2CS2019 warns at the instantiation site; named array results and maps.Equal over arrays work.
e9cad4647a, 2183bd9392, 0680af45b6, 354ce40c3f, c34bf7ae9f, 5635e9eb20 A named constraint over another type parameter, a generic pointer type implementing a generic interface twice, a generic struct embedding an interface it satisfies, generic structs embedded two levels down, a slice bound of an integer type parameter, and a local reusing a type parameter’s name compile.

Code that failed to compile

Merge Change
500ee417d5, 56c2222534 &p of a pointer parameter or receiver, any(p), interface{}(p) and PP(p) compile; a pointer method on a named func type compiles.
4129024a67 The address of an array element reached through a slice element, a pointer or a boxed variable compiles.
f57d44637f A method value taken in a function literal, with its receiver through a pointer, compiles.
3c98da4150, 5f116351bf Func-valued tuple results, and func results spread into parameters of another func type, compile.
0b6295683d, b41f41814c, 027815b1d0 A struct value-embedding another package’s struct converted to an interface through a pointer, an interface promoted through an alias, and a defined type over a named interface compile.
8ece076f79, 3cedb5e773 A defined string type compared with an untyped string constant, and a named untyped constant given to a defined float type, compile.
beb10acc62 A pointer type written through an alias is read as a pointer everywhere.
b0bd159e8f, 95d1f4b605 break L out of a labeled select, and f(nil...), compile.
3f127a36b7, 8625f3cd13, 6d0ca4a2c7, 08438e2244, f3fd95b5fa Type switches: a binding whose address is taken, a lone case nil: arm, array labels of different lengths, constant labels under an interface tag, and a method value beside a named func type convert as Go reads them.
f8b40575c3 Converted code no longer raises C# warnings CS0649, CS8778 or CS0108.

Code that reads closer to Go

Merge Change
29aa53015f A function with defer opens its frame on the signature line, and each lowered defer carries the Go statement as a comment.
e35b87f835 var c, python, java bool is one C# declaration.
fb2526882a, 356c633636 for v := range seq over an iterator function is a direct call of the iterator with the loop body as its yield, as Go’s compiler lowers it, where it ran the iterator on a second stack; a loop body that defers, parks, recovers or leaves by a non-local jump keeps the earlier form.
8d1c616466 golib’s internal helpers are called as builtin.<name>, so a Go declaration with the same name (tmpstring, len) cannot capture the converter’s own call.

cgo

Merge Change
299d32d798 C functions and variables a cgo preamble defines are compiled into a side-built library and called. A package’s #cgo flags are held to the go command’s allowed list, and on Windows the side library loads none of its dependents from the current directory.
ca3af91e62 A package’s own .c and .s files are compiled; warning GO2CS2017 names the files the go command links and the conversion does not.
f72cb41c75 On Windows, a bound C library’s dependents are never loaded from the current directory or PATH.
412d698677 An //exported Go function can be called back from C on the same thread.
ca855400f3 C.x and &C.x read and write a C global variable in place.
ee5f90adc4, 6e69ce74ac -cgo combines with -tests for one package; the new option -cgo-removals-dry-run; a Go struct viewed as a C struct crosses as an image.
cb868cba55, bddb992e0c, d229e5d09f, 1eb5b3e0cb, 15ae6a7535, 43bc309020 More of C’s memory crosses: a Go pointer as void*, char** out-parameters, values pinned with runtime.Pinner, arrays of C pointers, C structs holding pointer words, elements of Go slices of C structs, void * struct members.
f5862b0ac1, 92d334becb, 5c0f578b22 github.com/mattn/go-sqlite3 converts and compiles, with an undefined C name refused at conversion on every target; -tests builds a cgo package’s test host.
9a48dbc8cb A cgo package’s NuGet pack includes osx-arm64.

Windows and Native AOT

Merge Change
4385f03f0c A windows/amd64 system call goes through Go’s calling shape: a float result is returned, up to 42 arguments pass, Control Flow Guard checks the target, and a call block that is not on the thread’s stack is refused.
23be375b13, 9a55ccbd4f syscall.NewCallback binds callbacks of 0 to 16 arguments, also under Native AOT.
787d62cafa A program that handles SIGTERM gets Windows’ grace period on console close, logoff or shutdown, and the signal is delivered.
3d7aa8fbf1 A Native AOT publish turns identical-method folding off by default: it publishes several times faster, and the executable is larger. IlcFoldIdenticalMethodBodies=true restores it.
d093136bab A Native AOT publish writes no native debug symbols by default; NativeDebugSymbols=true restores them.
eb88fc75e0 An assertion to a func type trims cleanly under Native AOT.
a226d2683b append and reslicing take an in-place fast path.

Goroutines on a pool of threads (M:N, experimental)

Merge Change
22884b0d6e The opt-in (GoTwinsFor) ships in go.lib’s build files, so it works for a program converted anywhere.
05bf73402a The standard-library packages are built with their twins.
30e537ff41 The scheduler adds threads for a wait it cannot see, up to a ceiling set with debug.SetMaxThreads or GO2CS_MN_MAXTHREADS; hand-written C# that blocks in native code says so with GoNativeCall.
639adf1cda Each carrier thread reserves 1 GiB of stack, or what GO2CS_GOROUTINE_STACK says.

Platforms and the go2cs tool

Merge Change
794356390d, 195544727e, 00e05ac55a On Apple silicon the packages carry the darwin/arm64 standard library, -platforms darwin/arm64 is a conversion target, and the validated macOS rows were read again on that build.
68d912305a, d1ae0957bc A -recurse output root and a single-package conversion record their target platform, so they build the right standard library on Linux and macOS.
04f29bcb20 A standard library built for one operating system and run on another prints its warning before the fatal error.
3eeac4987d, f36e08fd2f A root staged by deploy-core, and -recurse run inside one, build.
8e0b1bab73 A go2cs built from source between releases reports a development version of the next release, and its -recurse=nuget refuses by name.
1da6aaf25d A conversion of a package with several files no longer crashes at random with a concurrent map write.
3be8222d62 A process that converts many packages no longer grows without bound.
7d8af59808, 4126d7073c, 6fbae1bc37, f5ff7330a3 A -tests host refuses dotnet test by name and builds by hand or in an IDE; a module’s test host finds its module root; a host launched through a Windows short path starts; a run warns when Go’s side cannot write its input directory.
a82699d6e7 GO2CS_CHECK_STRING_WRITES is an opt-in check that panics when a program writes into a string’s bytes.
3063d7e7cc unsafe views of a string’s or a slice’s bytes convert, and a conversion to an alias of unsafe.Pointer keeps its storage alive.
f1046a6dc7 go.lib ships a NOTICE for the parts derived from Go.

Breaks

Merge Change
58124df9a9, cb6def82a2 A Go variadic parameter is go.variadic<T>, not System.Span<T>; f(s...) hands the callee the caller’s slice, so its writes are kept. The break floor is 1.26.11.2.
d62a18c559 A defined func type is a delegate of its own.
fb2526882a net/http/httptest’s ResponseRecorder.Result loses its ref form.
9b71871b51 A converted Go internal or vendored package’s assembly records its root, and warning GO2CS0022 names hand-written C# that uses one of its types from outside it.
11f0a5dde1, c7cba87148, 528c057cfa, 067cccd25e, b297ccaa5e, 93ba8fd1a3, b84fd81611 The named-wrapper members, Δrecord, the Δ names, the numeric caster, @new<T>(), text/template’s accessors and the registry Key, each described in Upgrading above.