basebank / gophers-code-reading-party

Gophers Code Reading Party records
18 stars 1 forks source link

20211014 Gophers Code Reading Party #13

Closed budougumi0617 closed 1 year ago

budougumi0617 commented 2 years ago

@ Zoom, BASE BANK, Inc.

参加者

お題

ネタ

ネタがなかったら proposal: review meeting minutes をみてみよう!
https://github.com/golang/go/issues/33502

budougumi0617 commented 2 years ago

(Goなのに)Javaみたいに書かないで!って言いたいときはJavaesque codeって使うらしい。

interface切り過ぎとかファクトリーとかビルダーパターン使うとか。

「k8sは偉大な参考例だよね(皮肉)」ってfatihさんも言ってる

budougumi0617 commented 2 years ago

無駄にメンション飛ばしてしまった気がする()

budougumi0617 commented 2 years ago

スケジュール公開ー!

glassmonkey commented 2 years ago

888888

hgsgtk commented 2 years ago

トリなのか!(ドキッ

image

budougumi0617 commented 2 years ago

Grafanaの人が最近やってるサーバーの宣言方法

https://mobile.twitter.com/matryer/status/1445013230858952705

budougumi0617 commented 2 years ago

Go Modulesの読み方 https://zenn.dev/ryo_yamaoka/articles/595cf9e69229f9

retract とか知らなかった

budougumi0617 commented 2 years ago

tipでbytes pkgとstrings pkgにCutが入った。 https://github.com/golang/go/commit/8e36ab055162efa6f67f3b9ee62f625ac8874901 https://zenn.dev/mattn/articles/01f258a5127ef8

budougumi0617 commented 2 years ago

Go 1.17.2 and 1.16.9 are released! https://twitter.com/golang/status/1446247743148670989

budougumi0617 commented 2 years ago

Go版Java Puzzlers とりあえず買ってまだ未読だけど雰囲気tenntennさんたちのGo quizのほうがエグい気がする https://www.pragprog.com/titles/d-gobrain/go-brain-teasers/

budougumi0617 commented 2 years ago

HTTP Routerの比較 https://www.alexedwards.net/blog/which-go-router-should-i-use

budougumi0617 commented 2 years ago

今週のWeeklyはワタシ的に面白い記事多かった。 https://golangweekly.com/issues/382

budougumi0617 commented 2 years ago

https://twitter.com/__syumai/status/1446823274835374088?s=20 https://www.apollographql.com/blog/graphql/golang/using-graphql-with-golang/

budougumi0617 commented 2 years ago

GoのGenerics関連のAcceptされたProposalを全部紹介する会 2021/10/26(火) 19:30 〜 21:00 https://syumai.connpass.com/event/227501/

budougumi0617 commented 2 years ago

pike先生...!!

https://github.com/golang/go/issues/48918

budougumi0617 commented 2 years ago

今日はこちらです! https://zoom.us/j/96048293146?pwd=blA2YW9TQ29TMm9JU1lUWDQ5MjBwdz09

budougumi0617 commented 2 years ago

https://github.com/golang/go/issues/48918

Instead, I propose we still design, build, test, and use new libraries for slices, maps, channels, and so on, but start by putting them in the golang/x/exp repository.

pike先生が「1.18は変更でかすぎるからstd pkgの変更はx pkgでまずはやってみようや」みたいなことを提案している。

budougumi0617 commented 2 years ago

https://github.com/golang/go/issues/47487

func main() {
    var N int64
    cw := io.Writer(func(p []byte) (n int, err error) {
        n, err = os.Stdout.Write(p)
        N += int64(n)
        return n, err
    })
    // write things to cw
    fmt.Println(N, "bytes written")
}
budougumi0617 commented 2 years ago

いわゆるダックタイピングがいいとこなのに明示的に書いちゃうのはちょっと抵抗感あるにはあるな

budougumi0617 commented 2 years ago

https://www.pragprog.com/titles/d-gobrain/go-brain-teasers/

1,000円くらいだからとりあえず買ってみるとよさそうでした。 https://eowf.alc.co.jp/search?q=Brain+Teasers

brain | 【名】1.脳、大脳・The right hand is controlled b・・・
-- | --
  | 【他動】〔~の〕頭を殴る[たたき割る]、〔~の〕頭を打ち砕いて殺す

teaser | 【名】1.いじめる人、悩ます人◆【動】tease/2.〔人を悩ます〕難問/3.〈俗
-- | --
budougumi0617 commented 2 years ago

Go1.17.2 とかのセキュリティアップデートの内容 https://go-review.googlesource.com/c/go/+/354592/ wasmやってるときにでかすぎる引数渡すとメモリ空間を破壊できたらしい。

[release-branch.go1.17] misc/wasm, cmd/link: do not let command line args overwrite global data

1行でまとめてくれてたわ。

budougumi0617 commented 2 years ago

Gocon Autumn https://gocon.jp/2021autumn/sessions/workshop_a/ TinyGoのハンズオンは実際にIoT機材をくばってやるらしい。

Wio Terminal ボード

sam8helloworld commented 2 years ago

Gocon Autumn goでswitchのゲーム作るってこれのことか https://gocon.jp/2021autumn/sessions/go-nintendo-switch/ https://twitter.com/hajimehoshi/status/1401178737949872135?s=20

daisuzu commented 2 years ago

https://daisuzu.hatenablog.com/entry/2021/07/20/171712#1-%E3%83%80%E3%83%9F%E3%83%BC%E3%83%89%E3%83%A9%E3%82%A4%E3%83%90%E3%83%BC%E3%82%92%E4%BD%9C%E3%82%8B

budougumi0617 commented 2 years ago

replicaだめだったらmasterみるみたいな構造。sq/driver層でやるといいかも。。。? ↑

budougumi0617 commented 2 years ago

GoCon Autum、Mobility Technologiesの人とRettyの人がおおい雰囲気 複数人が出てるとおやってなるわね。

budougumi0617 commented 2 years ago

そういえばモックを使わないほうがいいよねっていう話があった。 https://blog.8-p.info/ja/2021/10/12/mock/

daisuzu commented 2 years ago

https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#Config

budougumi0617 commented 2 years ago

invokeOperation ってやつでAWS APIを叩いているんだけど、API叩く時の各ステップの処理はConfigのAPIOptionで上書きできる。なのでここでいい感じに処理をすげ替えるとAPI叩かなくてもテストできる!

func (c *Client) PutRecord(ctx context.Context, params *PutRecordInput, optFns ...func(*Options)) (*PutRecordOutput, error) {
    if params == nil {
        params = &PutRecordInput{}
    }

    result, metadata, err := c.invokeOperation(ctx, "PutRecord", params, optFns, c.addOperationPutRecordMiddlewares)
    if err != nil {
        return nil, err
    }

    out := result.(*PutRecordOutput)
    out.ResultMetadata = metadata
    return out, nil
}

https://github.com/aws/smithy-go/blob/565695c30ec008cde865c535293c7111fac7ce1f/middleware/stack.go#L9-L24

// Stack provides protocol and transport agnostic set of middleware split into
// distinct steps. Steps have specific transitions between them, that is
// managed by the individual step.
//
// Steps are composed as middleware around the underlying handler in the
// following order:
//
//   Initialize -> Serialize -> Build -> Finalize -> Deserialize -> Handler
//
// Any middleware within the chain may chose to stop and return an error or
// response. Since the middleware decorate the handler like a call stack, each
// middleware will receive the result of the next middleware in the chain.
// Middleware that does not need to react to an input, or result must forward
// along the input down the chain, or return the result back up the chain.
//
//   Initialize <- Serialize -> Build -> Finalize <- Deserialize <- Handler
budougumi0617 commented 2 years ago

GCPのAPIはgrpcなのでinterceptorを実装すると中身すげかえられる。

budougumi0617 commented 2 years ago

https://twitter.com/rakyll/status/1443609733093486602

Lack of understanding in data vs behavior driven typing.

Goはデータ駆動なのか振る舞い駆動なのか

pike先生がデータ駆動っていってなかったっけ?

daisuzu commented 2 years ago

https://ja.wikipedia.org/wiki/UNIX%E5%93%B2%E5%AD%A6#%E3%83%91%E3%82%A4%E3%82%AF:_C%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E3%81%AB%E9%96%A2%E3%81%99%E3%82%8B%E8%A6%9A%E3%81%88%E6%9B%B8%E3%81%8D

budougumi0617 commented 2 years ago

ルール5: データはすべてを決定づける。もし、正しいデータ構造を選び、ものごとをうまく構成すれば、アルゴリズムはほとんどいつも自明のものになるだろう。プログラミングの中心は、アルゴリズムではなくデータ構造にある。Rule 5. Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self­evident. Data structures, not algorithms, are central to programming.

budougumi0617 commented 2 years ago

データ駆動でやるほうがいいのがわかってけれど設計中のプロセスがどうかわっていくのかちゃんと説明できないな。

sam8helloworld commented 2 years ago

[memo] goのfirebase-admin-sdkとfirebaseのemulatorのAuthenticationに関する統合ステータスが「実装予定」になっているが、実際は既にAuthenticationに関してemulatorを利用可能(ローカルで確認済み) https://firebase.google.com/docs/emulator-suite/install_and_configure?hl=ja

https://github.com/firebase/firebase-admin-go/pull/446 がマージされてようやく実用レベルに