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" | |
) | |
func sliceExtender(sl []int) { | |
sl = append(sl, 33) | |
sl[0] = 5 | |
fmt.Printf("len %d, cap %d, sliceOne[0]=%d, added last elemnt =%d \n", len(sl), cap(sl), sl[0], sl[len(sl)-1]) |
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" | |
) | |
type steps struct { | |
dayOfTheWeek string | |
greeting string | |
tasks []string |
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
function buildItenary(options, startCity) { | |
const citiesMap = new Map() | |
options.forEach(([origin, dest]) => { | |
if (citiesMap.has(origin)) { | |
const stored = citiesMap.get(origin) | |
stored.push(dest) | |
citiesMap.set(origin, stored) | |
} else { | |
citiesMap.set(origin, [dest]) | |
} |
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 ( | |
"errors" | |
"fmt" | |
customError "github.com/pkg/errors" | |
) | |
type stackTracer interface { |
OlderNewer