Created
December 30, 2020 05:02
-
-
Save ridhoperdana/2db580642859127a55373f7415966681 to your computer and use it in GitHub Desktop.
example of code with additional comment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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