string split

Json diff를 뜨고 “\n”으로 split을 했는데 자꾸 예상한 길이보다 1씩 길게 나오는것이었다. go 내장함수인 strings.Split 요놈이 문제인가 해서 한번 테스트를 해봤다. hello := "안녕하세요\n 반갑습니다." + string(rune(10)) 문제가 되는 문자열의...

goland tips

cmd+ shift+ f => find in path (goland) 코드 어딧는지 찾기 딱좋다! cmd + O => 기능 쫙 보는 찾기

클로저를 고루틴으로 실행할때 주의할점.

go routine 만들 떄 익명함수로 할때 마지막 변수갑스로 다 써서 개망할뻔 Closure(클로저)는 함수 바깥에 있는 변수를 참조하는 함수값을 일컫는다. 함수가 선언될 때의 환경을 계속 유지하여 프로그램의 흐름을 변수에 저장하기 위해...

concurrency is not parallelism

https://talks.golang.org/2012/concurrency.slide#1 concurrency

aws-lambda-in-go

func Handler(ctx context.Context) error { file, err := os.Open("config.json") if err != nil{ return err } defer file.Close() conf := Configuration{} err = json.NewDecoder(file).Decode(&conf) if err != nil { return...