Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/namkatcedrickjumtock/golang-challanges
https://github.com/namkatcedrickjumtock/golang-challanges
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/namkatcedrickjumtock/golang-challanges
- Owner: namkatcedrickjumtock
- Created: 2022-09-05T15:33:12.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-01T23:13:40.000Z (about 2 years ago)
- Last Synced: 2024-06-22T00:13:24.134Z (5 months ago)
- Language: Go
- Size: 1.06 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# golang-tutorials
## Arrays / Slices
````
var ages [3]int = [3]int {1, 2 , 40} // strongely styped
var ages = [3]int {1, 2 , 40} // typed infered
ages = [3]int{1, 2, 3} // short hand assignmntnames[1] = 30
types like int, string applies for other types.
````````
slices uses arrays under the hoodvar score = []int{23 , 45 ,6}
newScores := append(score, 50) // doesn't append to the original slice but return a new slice of names
ftmt.printl(newScores) // print new score sith 50 added
ftmt.printl(score) // print original score
````
````
Slice Rangesnames := []String {'cedrick', 'Junior', 'prince', 'Prosper'}
rangeOne :=names[1:3]
ftmt.printl(rangeOne) // output junior and prince. starts at pos 1 but doesn't pos 3
````