7 Commits

Author SHA1 Message Date
David E. Wheeler
fc2f84a086 Use net.IP.Equal instead of bytes.Equal (#49)
As suggested by go-staticcheck.
2023-11-06 14:32:46 +09:00
Yoshiyuki Mineo
06f9b47996 Introduce New function (#47)
* feat(Sonyflake): define error variables

* feat(Sonyflake): add New() function
- minor logic improvements
- return errors

* tests(Sonyflake): remove old TestNilSonyflake test function in favour of the New() function coverage

* gofmt

* Update error messages and comments

* Introduce New function

---------

Co-authored-by: Quetzy Garcia <quetzy.garcia@integrate.com>
2023-08-14 01:27:55 +09:00
Yoshiyuki Mineo
597171da2e Increase coverage (#42)
* Introduce mocking framework and increase coverage (#22)

This change introduces two common golang patterns:

- types: this will allow fine-tuned control over imported
types by defining where they will be used and how

- mock: this allows the generation of mock constructors,
which allows for testing any individual path in a method by
"injecting" a mock method which matches the expected type

This change also increases test coverage to 100%

Co-authored-by: Yoshiyuki Mineo <Yoshiyuki.Mineo@jp.sony.com>

* gofmt

---------

Co-authored-by: Bradley Boutcher <btboutcher@icloud.com>
2023-05-04 00:08:20 +09:00
Yoshiyuki Mineo
cc94b60628 Check time order explicitly (#37)
* Add sortable test (#11)

* add TestSortableID to make sure that generated ID(s) can be sorted like you are using increment id database

* add TestSortableID to make sure that generated ID(s) can be sorted like you are using increment id database

Co-authored-by: Yoshiyuki Mineo <Yoshiyuki.Mineo@jp.sony.com>

* gofmt

* Check time order explicitly

Co-authored-by: Yusuf Syaifudin <yusuf.syaifudin@gmail.com>
2022-08-17 14:33:52 +09:00
Yoshiyuki Mineo
90e18212ad Add functions to get ID elements (#35)
* Refactoring

* Add functions to get ID elements
2022-08-12 18:42:10 +09:00
Osamu TONOMORI
848d664cee Make testing simple (#20)
* Make testing simpler

* Remove testing deps

* Simplemize tests
2020-08-27 10:17:19 +09:00
Yoshiyuki Mineo
ee7af3da63 Initial commit 2015-06-01 16:45:19 +09:00