Skip to content

Commit

Permalink
chore(docs): updated CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlangzi committed Apr 21, 2024
1 parent 8aae4e2 commit d16bfb3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [1.4.6] - 2014-04-21
### Changed
- implements json.Marshaler and json.Unmarshaler on `ID` (#39)

## [1.4.5] - 2014-04-20
### Changed
- used int64 instead of int in `Queryer.Count` (#37)
Expand Down
4 changes: 2 additions & 2 deletions shardid/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ func (b *ID) Scan(src interface{}) error { // skipcq: GO-W1029
}

// MarshalJSON implements the json.Marshaler interface
func (id ID) MarshalJSON() ([]byte, error) {
func (id ID) MarshalJSON() ([]byte, error) { // skipcq: GO-W1029
return json.Marshal(id.Int64)
}

// UnmarshalJSON implements the json.Unmarshaler interface
func (id *ID) UnmarshalJSON(data []byte) error {
func (id *ID) UnmarshalJSON(data []byte) error { // skipcq: GO-W1029
var value int64
if err := json.Unmarshal(data, &value); err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions shardid/id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ func TestID(t *testing.T) {
{
name: "build_should_work",
timeNow: time.Now(),
workerID: int8(rand.Intn(4)),
databaseID: int16(rand.Intn(1024)),
workerID: int8(rand.Intn(4)), // skipcq: GSC-G404
databaseID: int16(rand.Intn(1024)), // skipcq: GSC-G404
tableRotate: WeeklyRotate,
sequence: int16(rand.Intn(1024)),
sequence: int16(rand.Intn(1024)), // skipcq: GSC-G404
},
{
name: "id_should_orderable",
Expand Down

0 comments on commit d16bfb3

Please sign in to comment.