package
module
Version:
v0.1.4
Opens a new window with list of versions in this module.
Published: Jul 22, 2023
License: BSD-3-Clause
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
proverbs
Purpose
proverbs
helps me explaining both modules and vanity import paths in my course Master Go.
You can use it for integrating Go proverbs into your code.
Usage
package main
import (
"fmt"
"appliedgo.net/proverbs"
)
func main() {
fmt.Println("Random proverb:", proverbs.Random())
for i := 0; i < 19; i++ {
fmt.Printf("Proverb no %d: %s\n", i+1, proverbs.No(i))
}
}
Documentation
¶
No prints out proverb no. n.
package main
import (
"fmt"
"appliedgo.net/proverbs"
)
func main() {
fmt.Println(proverbs.No(18))
}
Output:
Don't panic.
Random returns a random Go Proverb.
Ensure to initialize math/rand with a random seed value, in order to get
true random output.
package main
import (
"fmt"
"appliedgo.net/proverbs"
)
func main() {
fmt.Println(proverbs.Random())
}
Output:
Source Files
¶
Click to show internal directories.
Click to hide internal directories.