Skip to content

Commit da62ba8

Browse files
committed
types: move versionStr to types_gojay.go and remove invalidID
1 parent ac24c2f commit da62ba8

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

types.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@ package jsonrpc2
77
import (
88
"encoding/json"
99
"fmt"
10-
"math"
1110
)
1211

1312
// Version represents a JSON-RPC version.
1413
const Version = "2.0"
1514

16-
var versionStr = string(Version)
17-
1815
// version is a special 0 sized struct that encodes as the JSON-RPC version
1916
// tag.
2017
// It will fail during decode if it is not the correct version tag in the
@@ -90,8 +87,6 @@ func NewIntID(v int64) ID { return ID{number: v} }
9087
// NewStringID returns a new string request ID.
9188
func NewStringID(v string) ID { return ID{name: v} }
9289

93-
const invalidID int64 = math.MaxInt64
94-
9590
// WireRequest is sent to a server to represent a Call or Notify operaton.
9691
type WireRequest struct {
9792
// JSONRPC is always encoded as the string "2.0"

types_gojay.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ func (m *RawMessage) UnmarshalJSON(data []byte) error {
5959
return nil
6060
}
6161

62+
var versionStr = string(Version)
63+
6264
// MarshalJSONObject implements gojay.MarshalerJSONObject.
6365
func (r *version) MarshalJSONObject(enc *gojay.Encoder) {
6466
enc.String(Version)

0 commit comments

Comments
 (0)