Closed budougumi0617 closed 1 year ago
Stripe + Firestore + Goによるサブスクリプション機能の構築(実践編) https://note.com/ogiogi93/n/na35ad141101a
stripe apiの実装評判いいので読んでもいいかも
https://twitter.com/Linda_pp/status/1485233205188116480 https://dominictobias.medium.com/go-is-about-to-get-a-whole-lot-faster-a50c1e7d60b9
ジェネリクスを使って interface{} を避けることで2〜3倍速くなる(こともある)という話らしい
https://twitter.com/__syumai/status/1486135009262313473 https://kdy1.dev/posts/2022/1/tsc-go
https://twitter.com/__syumai/status/1486135894402912260
tsc uses a lot of shared mutability and many parts depend on garbage collection. Even though I’m an advocate and believer in Rust, it doesn’t feel like the right tool for the job here.
こういうのちゃんと考えて言語選択できる人すごいなあ。
コードリーディングわいわい
@daisuzu 申し訳ないです、日付間違っていました、先週やったので来週開催(2/3)とさせてください… 🙇 (私としては臨時に今日やってもよい気持ちですが、ちょうど別MTGも入っていました 😇
了解です 👍
K-V storeの実装。小さいので読みやすいかもしれない。 https://github.com/flower-corp/rosedb
80行のDNSリゾルバー https://jvns.ca/blog/2022/02/01/a-dns-resolver-in-80-lines-of-go/
net/httpパッケージとか読む前の肩慣らしによいかな。。。?
SO_REUSEADDR / SO_REUSEPORT を使ったストリーミング配信サーバの無停止アップデート(Hot Deploy)
https://tech.mirrativ.stream/entry/streaming-server-hotdeploy
肝心なやつをわすれとったね
2つのtime.Timeの差が1秒以下なのを判定するのに
x.Sub(y) <= time.Second
と書いたんですが、↓の方が良いみたいですね
!x.Add(time.Second).Before(y)
元ネタ
おおおー!!
うちはいつも EquateApproxTime
つかってごまかしてますね。。。w
https://pkg.go.dev/github.com/google/go-cmp@v0.5.7/cmp/cmpopts#EquateApproxTime
got := repo.GetUser(ctx, db, id)
// got.Created みたいな time.Timeフィールドの誤差を消したい
if diff := cmp.Diff(got, want, cmpopts.EquateApproxTime(1*time.Second)); diff != "" {
ってか1秒なら 1 *
書く必要ないのか。。。!
byebye constraints pkg.
constraints: remove package https://go-review.googlesource.com/c/go/+/382460/
普通に変数の型として使うことも想定される未来も含めるとconstraints pkgって名前もどうなん?って話とかいろいろあるらしい
generics、ライブラリ作ってるひとがこういうのをcomparebleにするとか。。。?
func Equal(x, y interface{}, opts ...Option) bool
https://twitter.com/Linda_pp/status/1485233205188116480 https://dominictobias.medium.com/go-is-about-to-get-a-whole-lot-faster-a50c1e7d60b9
ジェネリクスを使って interface{} を避けることで2〜3倍速くなる(こともある)という話らしい
webアプリケーション作ってるときはここでサチらないので可読性などを下げてまでgenericsにはしないかな。
https://github.com/DominicTobias/deque/commit/6ebbf656ded60f6e317b016b3df0ef0dd258c7d6 type assertionなくなったりたしかに早くはなりそうって感じのdiffだった。
https://twitter.com/__syumai/status/1486135009262313473 https://kdy1.dev/posts/2022/1/tsc-go
https://twitter.com/__syumai/status/1486135894402912260
tsc uses a lot of shared mutability and many parts depend on garbage collection. Even though I’m an advocate and believer in Rust, it doesn’t feel like the right tool for the job here.
こういうのちゃんと考えて言語選択できる人すごいなあ。
tsc uses a lot of shared mutability and many parts depend on garbage collection. Even though I’m an advocate and believer in Rust, it doesn’t feel like the right tool for the job here. Using Rust required me to use unsafe too much for this specific project.
https://zenn.dev/nobonobo/articles/9a9f12b27bfde9
Goにおける例外は非同期の世界に階層化中断機構をもたらしたcontext.Contextであるという意見もある(非同期の世界では広域脱出よりも中断の方が重要)
これはたしかにというかそういう風にみたことがなかったのでなるほどなと思いました
SO_REUSEADDR / SO_REUSEPORT を使ったストリーミング配信サーバの無停止アップデート(Hot Deploy)
https://tech.mirrativ.stream/entry/streaming-server-hotdeploy
maki-sanがポートしているやつ https://github.com/lestrrat-go/server-starter
cmd.ExtraFiles = files listnerからもってきたファイルディスクリプタを os/exec#Cmd.ExtraFiles にセットするとそれが立ち上げたプロセスでつかえるコネクションになる。。。? https://pkg.go.dev/os/exec@go1.17.6#Cmd
実行されるサブプロセスのほうのサーバーは ListenAll
関数を使えば環境設定に指定されたファイルディスクリプタの番号でコネクションをはるので、 cmd.ExtraFiles
経由で親のファイルディスクリプタを使うって感じだった。
https://pkg.go.dev/os#NewFile https://pkg.go.dev/net#FileListener
func NewFile(fd uintptr, name string) *File
func FileListener(f *os.File) (ln Listener, err error)
15:00~16:00 @ Zoom, BASE BANK, Inc.
参加者
@daisuzu @budougumi0617 @glassmonkey
お題
ネタ
ネタがなかったら proposal: review meeting minutes をみてみよう!
https://github.com/golang/go/issues/33502