Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20211014 Gophers Code Reading Party #13

Closed
budougumi0617 opened this issue Oct 1, 2021 · 35 comments
Closed

20211014 Gophers Code Reading Party #13

budougumi0617 opened this issue Oct 1, 2021 · 35 comments

Comments

@budougumi0617
Copy link
Contributor

budougumi0617 commented Oct 1, 2021

@ Zoom, BASE BANK, Inc.

参加者

お題

ネタ

ネタがなかったら proposal: review meeting minutes をみてみよう!
golang/go#33502

@budougumi0617
Copy link
Contributor Author

budougumi0617 commented Oct 1, 2021

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

Don't write Java-esque code in #golang. I think I might add this tweet to https://t.co/8H3p6Ylh56 https://t.co/kSYTnOeuId

— Damian Gryski (@ dgryski) September 30, 2021

Introducing an interface type for every type.
Lack of understanding in data vs behavior driven typing.
Long chain of factories and builders rather than Go style constructors.
Excessive use of empty interface types as interfaces.

— Jaana Dogan ヤナ ドガン (@ rakyll) September 30, 2021

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

Kubernetes is a great example of Java-esque code in #golang

— Fatih Arslan (@ fatih) September 30, 2021

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

@budougumi0617
Copy link
Contributor Author

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

@budougumi0617
Copy link
Contributor Author

スケジュール公開ー!

2021/11/13 開催の Go Conference 2021 Autumn のトークスケジュールと発表者情報を公開しました! https://t.co/ueXr0ShydS #gocon

— Go Conference (@goconjp) October 2, 2021

@glassmonkey
Copy link
Contributor

888888

@hgsgtk
Copy link
Contributor

hgsgtk commented Oct 2, 2021

トリなのか!(ドキッ

image

@budougumi0617
Copy link
Contributor Author

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

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

@budougumi0617
Copy link
Contributor Author

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

retract とか知らなかった

@budougumi0617
Copy link
Contributor Author

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

@budougumi0617
Copy link
Contributor Author

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

@budougumi0617
Copy link
Contributor Author

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

@budougumi0617
Copy link
Contributor Author

@budougumi0617
Copy link
Contributor Author

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

@budougumi0617
Copy link
Contributor Author

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

Apollo Blogでgqlgenの使い方が紹介されてる(しかも結構詳細に書いてある)

Using GraphQL with Golang https://t.co/wrVUJWiz2b

— syumai (@__syumai) October 9, 2021

@budougumi0617
Copy link
Contributor Author

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

@budougumi0617
Copy link
Contributor Author

pike先生...!!

golang/go#48918

@budougumi0617
Copy link
Contributor Author

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

@budougumi0617
Copy link
Contributor Author

golang/go#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
Copy link
Contributor Author

これは結構面白い提案(Genericsとは関係ないやつ)
1 methodしか持たないinterfaceに対して、そのmethodと一致するシグニチャの関数を渡すことでinterfaceの実装を完了出来る => 関数一個さえあればinterfaceを実装する型を別途宣言する必要が無くなる。と言うやつhttps://t.co/wNckVHcq5M

— syumai (@__syumai) August 23, 2021

golang/go#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
Copy link
Contributor Author

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

@budougumi0617
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

budougumi0617 commented Oct 14, 2021

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

Wio Terminal ボード

@sam8helloworld
Copy link

sam8helloworld commented Oct 14, 2021

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

@budougumi0617
Copy link
Contributor Author

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

@budougumi0617
Copy link
Contributor Author

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

@budougumi0617
Copy link
Contributor Author

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

@daisuzu
Copy link

daisuzu commented Oct 14, 2021

@budougumi0617
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@budougumi0617
Copy link
Contributor Author

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

Lack of understanding in data vs behavior driven typing.

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

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

@budougumi0617
Copy link
Contributor Author

ルール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
Copy link
Contributor Author

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

@sam8helloworld
Copy link

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

firebase/firebase-admin-go#446
がマージされてようやく実用レベルに

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants