Граф коммитов

12 Коммитов

Автор SHA1 Сообщение Дата
Fabian Holler b94ea975f3 codes: fix: marshal/unmarshal a Code to JSON fails (#2116)
Marshalling a Code to JSON and unmarshalling it failed with an
"invalid code" error message.

Code is of type uint32. It has no custom MarshalJson() implemented
therefore it is marshalled into an JSON integer value.
The UnmarshalJSON() function expected that the marshalled Code is a
String type, unmarshalling failed.

Check in UnmarshalJSON() if the value is an uint32 in the range of the
defined Code values. If it is, unmarshal it.

This commit also adds an Marshal/Unmarshal testcase.
2018-06-01 10:56:55 -07:00
田欧 8a8ac82f1f update const order (#1770) 2018-01-04 15:44:29 -08:00
dfawley 2941ee12eb
codes: Add UnmarshalJSON support to Code type (#1720) 2017-12-11 09:02:19 -08:00
Menghan Li b8191e57b2
remove stringer and go generate (#1715) 2017-12-06 17:35:20 -08:00
Menghan Li b7dc71e7ea
Optimize codes.String() method using a switch instead of a slice of indexes (#1712) 2017-12-06 10:50:43 -08:00
dfawley c1fc29613d update code_string.go for new stringer changes (#1674)
To fix travis check failures
2017-11-14 15:20:10 -08:00
dfawley 25b4a426b4 go-generate pb.go files and check in Travis to make sure they don't change (#1426) 2017-08-17 16:00:51 -07:00
Jan Tattermusch ddbf6c46a6 autofix license notice 2017-06-08 14:42:19 +02:00
Mehrdad Afshari 5e42b6f37e Fixed comment spelling (#1254) 2017-05-22 13:13:07 -07:00
Max Hawkins 972dbd2cb2 Run stringer on codes.Code
This makes error codes easier to read:
fmt.Sprint(codes.OK) == "OK" instead of "0"
2015-03-24 10:15:18 -07:00
David Symonds 3981839a52 Add import comments to grpc packages.
This enforces that these packages are used with these import paths.
See http://golang.org/cmd/go/#hdr-Import_path_checking for documentation.
2015-02-09 13:46:16 +11:00
David Symonds e71095e0ec Move source files up one level.
The top-level directory in this repository is going to be
the main "grpc" package.
2015-02-09 11:33:38 +11:00