How to use foreach loop in Go

1 Answer

0 votes
package main

import "fmt"

func main() {

	arr := []string{"go", "c++", "php", "python"}

	for _, s := range arr {
		fmt.Println(s)
	}
}
 
 
 
/*
run:
 
go
c++
php
python
 
*/

 



answered Aug 7, 2020 by avibootz

Related questions

1 answer 207 views
1 answer 241 views
4 answers 453 views
453 views asked Jun 10, 2023 by avibootz
1 answer 288 views
288 views asked Oct 28, 2020 by avibootz
1 answer 298 views
298 views asked Oct 28, 2020 by avibootz
1 answer 284 views
284 views asked Oct 28, 2020 by avibootz
1 answer 293 views
...