Skip to content

Commit

Permalink
Merge pull request #230 from novalagung/fix/random
Browse files Browse the repository at this point in the history
fix: add missing main code
  • Loading branch information
novalagung authored Jun 27, 2023
2 parents b38b101 + db50413 commit 3e1821a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions content/A-random.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ func randomString(length int) string {
}
return string(b)
}

func main() {
fmt.Println("random string 5 karakter:", randomString(5))
}
```

Dengan fungsi di atas kita bisa dengan mudah meng-generate string random dengan panjang karakter yang sudah ditentukan, misal `randomString(10)` akan menghasilkan random string 10 karakter.
Expand Down

0 comments on commit 3e1821a

Please sign in to comment.