This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
use num::traits::{Zero, Rem}; | |
fn gcd<T>(a: T, b: T) -> T | |
where | |
T: Zero + Rem<Output = T> + std::cmp::PartialEq + Copy, | |
{ | |
if b == T::zero() { | |
return a; | |
} | |
gcd(b, a % b) |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
package main | |
import ( | |
"crypto" | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/sha256" | |
"encoding/base64" | |
"fmt" | |
) |