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

Optional[T]を実装 #40

Merged
merged 7 commits into from
Jun 18, 2022
Merged

Optional[T]を実装 #40

merged 7 commits into from
Jun 18, 2022

Conversation

oribe1115
Copy link
Contributor

No description provided.

Copy link
Contributor

@logica0419 logica0419 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます!
綺麗で良いですね~
強いて言うなら~という感じの点を指摘したのでご意見欲しいです

@logica0419
Copy link
Contributor

あ、あと前はsql.Null~~を使っていたので大丈夫だったんですけど、ScannerValuerも実装しないとGormで使えないので、そこも実装していただきたいです

@logica0419
Copy link
Contributor

蛇足かもしれませんが参考までに
今sqlパッケージの中身見てましたがScanが死ぬほど複雑になりそうなので、型スイッチしてsql.Null~~でプロキシするような実装にするのが楽そうですね

@oribe1115
Copy link
Contributor Author

oribe1115 commented Jun 18, 2022

@logica0419
命名など含めこの実装形式でいいですかね?
よさそうなら、これにあわせて必要な各Interfaceをちゃんと満たしているかなどのテストを追加しておこうと思います

@logica0419
Copy link
Contributor

はい、この実装方針で行きたいです
よろしくお願いします〜

@oribe1115
Copy link
Contributor Author

Of.Value()だけテストの仕方が思いつかなかったのだけど、まあシンプルなメソッドだし大丈夫かなって思ってます

@oribe1115 oribe1115 requested a review from logica0419 June 18, 2022 10:27
@oribe1115 oribe1115 changed the title Optional[T]の実装の提案 Optional[T]を実装 Jun 18, 2022
Copy link
Contributor

@logica0419 logica0419 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大変ありがとうございます、テストの内容もPerfect
一点だけ指摘したので確認お願いします

@oribe1115
Copy link
Contributor Author

optional_test.goをoptional_testパッケージに切り出しました
それに際してOptionalType型をがexportedになりましたが、特に問題無いと思います

Copy link
Contributor

@logica0419 logica0419 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

パーフェクトです、ありがとうございます

@oribe1115 oribe1115 merged commit 5f6f643 into main Jun 18, 2022
@oribe1115 oribe1115 deleted the golang-optional branch June 18, 2022 12:38
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

Successfully merging this pull request may close these issues.

3 participants