Closed budougumi0617 closed 1 year ago
2/21 Go 1.20 リリースパーティ https://gocon.connpass.com/event/273096
枠はもっと増やす調整中です
3/9 Go言語プログラミングエッセンス https://www.amazon.co.jp/dp/4297134195
FutureさんのGo 1.20リリース連載 https://future-architect.github.io/articles/20230123a/
Share your feedback about developing with Go https://go.dev/blog/survey2023-q1
Software Design (ソフトウェアデザイン) 2023年2月号 https://www.amazon.co.jp/dp/B0BRYWJTKW
なるほど納得Go言語
Go at GoogleとかWhy Go?的な話だった。知らないのもあったしすごい
ちょっと今回は少なめかもしれない
Go Conferenceのプロポーザルは今週末締め切り https://sessionize.com/go-conference-2023-online/
Go1.20でサポート予定の統合テスト用カバレッジプロファイリングを触る https://zenn.dev/moneyforward/articles/25469f8d60621b
これでLambdaがコールドスタートしたかわかるのか、ハック感ある。
// WrapHandlerWithListeners wraps a lambda handler, and calls listeners before and after every invocation.
func WrapHandlerWithListeners(handler interface{}, listeners ...HandlerListener) interface{} {
err := validateHandler(handler)
if err != nil {
// This wasn't a valid handler function, pass back to AWS SDK to let it handle the error.
logger.Error(fmt.Errorf("handler function was in format ddlambda doesn't recognize: %v", err))
return handler
}
coldStart := true
// Return custom handler, to be called once per invocation
return func(ctx context.Context, msg json.RawMessage) (interface{}, error) {
//nolint
ctx = context.WithValue(ctx, "cold_start", coldStart)
for _, listener := range listeners {
ctx = listener.HandlerStarted(ctx, msg)
}
CurrentContext = ctx
result, err := callHandler(ctx, msg, handler)
for _, listener := range listeners {
ctx = context.WithValue(ctx, extension.DdLambdaResponse, result)
listener.HandlerFinished(ctx, err)
}
coldStart = false
CurrentContext = nil
return result, err
}
}
遅延評価している。clientは最初に初期化するけれど、データが必要になるのはユーザーが書いた関数の実行後だから。 https://github.com/DataDog/datadog-lambda-go/blob/ff5fffbace038f9a2017e70ad7ce5c09ff601b9e/internal/metrics/api.go#L121-L134
func (cl *APIClient) decryptAPIKey(decrypter Decrypter, kmsAPIKey string) <-chan string {
ch := make(chan string)
go func() {
result, err := decrypter.Decrypt(kmsAPIKey)
if err != nil {
logger.Error(fmt.Errorf("Couldn't decrypt api kms key %s", err))
}
ch <- result
close(ch)
}()
return ch
}
15:00~16:00 @ Zoom, BASE BANK, Inc.
参加者
お題
ネタ
ネタがなかったら proposal: review meeting minutes をみてみよう!
https://github.com/golang/go/issues/33502