Skip to content

Instantly share code, notes, and snippets.

@ridhoperdana
Last active December 30, 2020 05:20
Show Gist options
  • Select an option

  • Save ridhoperdana/fba9ddaad5ff3e7138db7ef4221e97d8 to your computer and use it in GitHub Desktop.

Select an option

Save ridhoperdana/fba9ddaad5ff3e7138db7ef4221e97d8 to your computer and use it in GitHub Desktop.
example of write everthing twice
package main
import (
"fmt"
)
func main() {
juniorEngineers := []string{"John", "Doe"}
for index, engineer := range juniorEngineers {
fmt.Printf("Some string at index %v with value %v", index, engineer)
}
seniorEngineers := []string{"Budi", "Agus"}
for index, engineer := range seniorEngineers {
fmt.Printf("Some string at index %index with value %engineer", index, engineer)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment