Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
adad9220
Commit
adad9220
authored
Jan 08, 2019
by
Cristian Maglie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update gopkg.in/yaml.v2 from 2.2.1 to 2.2.2
Fix #112
parent
ded2cc3d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
3 deletions
+31
-3
Gopkg.lock
Gopkg.lock
+3
-3
vendor/gopkg.in/yaml.v2/encode.go
vendor/gopkg.in/yaml.v2/encode.go
+28
-0
No files found.
Gopkg.lock
View file @
adad9220
...
...
@@ -413,12 +413,12 @@
version = "v1.0.5"
[[projects]]
digest = "1:
342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202
"
digest = "1:
4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96
"
name = "gopkg.in/yaml.v2"
packages = ["."]
pruneopts = "UT"
revision = "5
420a8b6744d3b0345ab293f6fcba19c978f1183
"
version = "v2.2.
1
"
revision = "5
1d6538a90f86fe93ac480b35f37b2be17fef232
"
version = "v2.2.
2
"
[solve-meta]
analyzer-name = "dep"
...
...
vendor/gopkg.in/yaml.v2/encode.go
View file @
adad9220
...
...
@@ -13,6 +13,19 @@ import (
"unicode/utf8"
)
// jsonNumber is the interface of the encoding/json.Number datatype.
// Repeating the interface here avoids a dependency on encoding/json, and also
// supports other libraries like jsoniter, which use a similar datatype with
// the same interface. Detecting this interface is useful when dealing with
// structures containing json.Number, which is a string under the hood. The
// encoder should prefer the use of Int64(), Float64() and string(), in that
// order, when encoding this type.
type
jsonNumber
interface
{
Float64
()
(
float64
,
error
)
Int64
()
(
int64
,
error
)
String
()
string
}
type
encoder
struct
{
emitter
yaml_emitter_t
event
yaml_event_t
...
...
@@ -89,6 +102,21 @@ func (e *encoder) marshal(tag string, in reflect.Value) {
}
iface
:=
in
.
Interface
()
switch
m
:=
iface
.
(
type
)
{
case
jsonNumber
:
integer
,
err
:=
m
.
Int64
()
if
err
==
nil
{
// In this case the json.Number is a valid int64
in
=
reflect
.
ValueOf
(
integer
)
break
}
float
,
err
:=
m
.
Float64
()
if
err
==
nil
{
// In this case the json.Number is a valid float64
in
=
reflect
.
ValueOf
(
float
)
break
}
// fallback case - no number could be obtained
in
=
reflect
.
ValueOf
(
m
.
String
())
case
time
.
Time
,
*
time
.
Time
:
// Although time.Time implements TextMarshaler,
// we don't want to treat it as a string for YAML
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment