go.gen
1.26.10.3
dotnet add package go.gen --version 1.26.10.3
NuGet\Install-Package go.gen -Version 1.26.10.3
<PackageReference Include="go.gen" Version="1.26.10.3"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="go.gen" Version="1.26.10.3" />
<PackageReference Include="go.gen"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add go.gen --version 1.26.10.3
#r "nuget: go.gen, 1.26.10.3"
#:package go.gen@1.26.10.3
#addin nuget:?package=go.gen&version=1.26.10.3
#tool nuget:?package=go.gen&version=1.26.10.3
go.gen — go2cs source generator
go.gen is the Roslyn source generator / analyzer used by go2cs to emit the compile-time C# glue that makes converted Go code behave like Go:
- interface satisfaction (duck-typed GoImplement wiring),
- pointer-receiver method overloads,
- implicit type-alias conversions,
- struct embedding / promotion,
- lazily built package variables,
- field access through pointers reinterpreted from unsafe.Pointer,
- throwing stubs for Go functions with no Go body (assembly or cgo),
- Go-string boxing for string literals passed to any parameters,
- the records Go reflection reads (channel directions, struct member facts, container operations).
Two analyzers ship with the generator and fail the build when a C# string literal binds a C# type where Go has a string, or when a stack-append buffer is passed as anything but a plain local.
Install go.gen when you convert your own Go code to C# with go2cs — the generator must run at compile time so the generated members are available. The pre-converted Go standard-library packages (go.fmt, go.strings, …) already have this glue baked into their compiled assemblies, so consuming those packages does not require go.gen.
This is a development-time dependency (analyzer); it ships no runtime assembly.
License
MIT. See the go2cs repository.
Artwork licensed under Creative Commons Attribution 3.0; see artwork attribution.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.26.10.3 | 191 | 11/9/2026 |
| 1.26.10.2 | 131 | 11/4/2026 |
| 1.26.10.1 | 133 | 10/26/2026 |
| 1.24.13.7 | 120 | 10/14/2026 |
| 1.24.13.6 | 116 | 10/12/2026 |
| 1.24.13.5 | 113 | 10/9/2026 |
| 1.24.13.4 | 117 | 10/6/2026 |
| 1.24.13.3 | 114 | 10/2/2026 |
| 1.24.13.2 | 104 | 9/24/2026 |
| 1.24.13.1 | 108 | 9/24/2026 |
| 1.23.12.3 | 130 | 9/8/2026 |
| 1.23.12.2 | 120 | 8/29/2026 |
| 1.23.12.1 | 113 | 8/26/2026 |
| 1.23.1.7 | 121 | 8/23/2026 |
| 1.23.1.6 | 126 | 8/11/2026 |
| 1.23.1.5 | 118 | 8/9/2026 |
| 1.23.1.4 | 120 | 8/8/2026 |
| 1.23.1.3 | 125 | 8/4/2026 |
| 1.23.1.2 | 129 | 7/27/2026 |
| 1.23.1.1 | 152 | 7/14/2026 |