Skip to content

Implement all Go By Example topics in .NET (C#, VB.NET, F#)#33

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/implement-go-by-example
Draft

Implement all Go By Example topics in .NET (C#, VB.NET, F#)#33
Copilot wants to merge 3 commits intomainfrom
copilot/implement-go-by-example

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 21, 2026

Adds 83 new example directories covering every topic from the Go By Example checklist, each with idiomatic .NET equivalents in three languages.

Structure

Each example follows the existing hello-world convention — one directory per topic containing:

  • *.csx — C# script
  • *.vb — VB.NET script
  • *.fsx — F# script
  • *.bat — runner instructions

Coverage

Category Examples
Basics Values, Variables, Constants, For, If/Else, Switch, Arrays, Slices, Maps
Functions & Types Functions, Multiple Return Values, Variadic, Closures, Recursion, Structs, Methods, Interfaces, Enums, Generics, Struct Embedding
Concurrency Goroutines → Task, Channels → System.Threading.Channels, Select → Task.WhenAny, Timeouts/CancellationToken, Worker Pools, Mutexes, Atomic Counters, WaitGroups, Tickers/PeriodicTimer
Error Handling Errors, Custom Errors, Panic → throw, Defer → using/try-finally, Recover → try-catch
Standard Library JSON, XML, Regex, Time/Epoch, Hashing, Base64, String Functions/Formatting, Templates
I/O & System File read/write, Directories, CLI args/flags/subcommands, Env vars, HTTP client/server, Processes, Signals, Context → CancellationToken

Example mapping

// Goroutines → Task.Run
var t1 = Task.Run(() => F("goroutine"));

// Channels → System.Threading.Channels
var ch = Channel.CreateUnbounded<string>();
await ch.Writer.WriteAsync("ping");
var msg = await ch.Reader.ReadAsync();

// Select → Task.WhenAny
var completed = await Task.WhenAny(c1.Reader.ReadAsync().AsTask(), c2.Reader.ReadAsync().AsTask());

// WaitGroup → CountdownEvent / Task.WhenAll
var wg = new CountdownEvent(numWorkers);

The site generator processes all 84 example directories and produces 85 HTML files (84 examples + index).

Original prompt

This section details on the original issue you should resolve

<issue_title>Go By Example</issue_title>
<issue_description>

Discussed in #1

Originally posted by AlexHedley May 10, 2025

Implement the following in .NET

  • Hello World
  • Values
  • Variables
  • Constants
  • For
  • If/Else
  • Switch
  • Arrays
  • Slices
  • Maps
  • Functions
  • Multiple Return Values
  • Variadic Functions
  • Closures
  • Recursion
  • Range over Built-in Types
  • Pointers
  • Strings and Runes
  • Structs
  • Methods
  • Interfaces
  • Enums
  • Struct Embedding
  • Generics
  • Range over Iterators
  • Errors
  • Custom Errors
  • Goroutines
  • Channels
  • Channel Buffering
  • Channel Synchronization
  • Channel Directions
  • Select
  • Timeouts
  • Non-Blocking Channel Operations
  • Closing Channels
  • Range over Channels
  • Timers
  • Tickers
  • Worker Pools
  • WaitGroups
  • Rate Limiting
  • Atomic Counters
  • Mutexes
  • Stateful Goroutines
  • Sorting
  • Sorting by Functions
  • Panic
  • Defer
  • Recover
  • String Functions
  • String Formatting
  • Text Templates
  • Regular Expressions
  • JSON
  • XML
  • Time
  • Epoch
  • Time Formatting / Parsing
  • Random Numbers
  • Number Parsing
  • URL Parsing
  • SHA256 Hashes
  • Base64 Encoding
  • Reading Files
  • Writing Files
  • Line Filters
  • File Paths
  • Directories
  • Temporary Files and Directories
  • Embed Directive
  • Testing and Benchmarking
  • Command-Line Arguments
  • Command-Line Flags
  • Command-Line Subcommands
  • Environment Variables
  • Logging
  • HTTP Client
  • HTTP Server
  • Context
  • Spawning Processes
  • Exec'ing Processes
  • Signals
  • Exit</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Implement Go by Example in .NET Implement all Go By Example topics in .NET (C#, VB.NET, F#) Mar 21, 2026
Copilot AI requested a review from AlexHedley March 21, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Go By Example

2 participants