From 0bc255d1841c99da04dcdf08a83d288c05d04db7 Mon Sep 17 00:00:00 2001 From: tocariimaa Date: Fri, 28 Feb 2025 19:11:34 -0300 Subject: [PATCH] articles/golang.md: update article --- articles/golang.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/articles/golang.md b/articles/golang.md index ee7f696..a30c51a 100644 --- a/articles/golang.md +++ b/articles/golang.md @@ -44,7 +44,8 @@ package main import "fmt" -// functions starting in uppercase are exported +// Functions starting in uppercase are exported, not needed here but for +// demonstration purposes. func Fact(n uint) uint { res := uint(1) for n > 0 { // no while loop in Go @@ -56,7 +57,7 @@ func Fact(n uint) uint { func main() { // Array literal, the `...` is used to infer its size - // If you instead left the [] empty it becomes an slice (heap allocated) + // If you instead left the [] empty it becomes a slice (heap allocated) ns := [...]uint{0, 4, 10, 1, 5, 8} for _, n := range ns { fmt.Printf("Fact(%d) = %d\n", n, Fact(n))