Skip to content

Instantly share code, notes, and snippets.

@ridhoperdana
Created December 30, 2020 05:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ridhoperdana/2db580642859127a55373f7415966681 to your computer and use it in GitHub Desktop.
Save ridhoperdana/2db580642859127a55373f7415966681 to your computer and use it in GitHub Desktop.
example of code with additional comment
package main
import (
"fmt"
)
// Print engineer names that is still junior
func printEngineerName(names []string, isJunior bool) {
if !isJunior {
return
}
for index, engineer := range names {
fmt.Printf("Some string at index %v with value %v", index, engineer)
}
}
func main() {
juniorEngineers := []string{"John", "Doe"}
printEngineerName(juniorEngineers, true)
seniorEngineers := []string{"Budi", "Agus"}
printEngineerName(seniorEngineers, false)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment