Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: unistack-org/micro
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.3.13
Choose a base ref
...
head repository: unistack-org/micro
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.3.14
Choose a head ref
  • 5 commits
  • 5 files changed
  • 2 contributors

Commits on Apr 10, 2021

  1. Copy the full SHA
    11dc6fd View commit details

Commits on Apr 14, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    56e5b70 View commit details

Commits on Apr 16, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    840af55 View commit details
  2. remove stale generate stuff

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Apr 16, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b733f13 View commit details

Commits on Apr 18, 2021

  1. util/reflect: add interface merging

    Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
    vtolstov committed Apr 18, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    6537b35 View commit details
Showing with 14 additions and 22 deletions.
  1. +0 −15 .github/generate.sh
  2. +0 −3 generate.go
  3. +1 −1 go.mod
  4. +3 −3 go.sum
  5. +10 −0 util/reflect/reflect.go
15 changes: 0 additions & 15 deletions .github/generate.sh

This file was deleted.

3 changes: 0 additions & 3 deletions generate.go

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -9,5 +9,5 @@ require (
github.com/imdario/mergo v0.3.12
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/silas/dag v0.0.0-20210121180416-41cf55125c34
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4
golang.org/x/net v0.0.0-20210415231046-e915ea6b2b7d
)
6 changes: 3 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
@@ -10,12 +10,12 @@ github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaR
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/silas/dag v0.0.0-20210121180416-41cf55125c34 h1:vBfVmA5mZhsQa2jr1FOL9nfA37N/jnbBmi5XUfviVTI=
github.com/silas/dag v0.0.0-20210121180416-41cf55125c34/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210415231046-e915ea6b2b7d h1:BgJvlyh+UqCUaPlscHJ+PN8GcpfrFdr7NHjd1JL0+Gs=
golang.org/x/net v0.0.0-20210415231046-e915ea6b2b7d/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
10 changes: 10 additions & 0 deletions util/reflect/reflect.go
Original file line number Diff line number Diff line change
@@ -280,6 +280,8 @@ func mergeBool(dval reflect.Value, sval reflect.Value) error {
default:
return ErrInvalidValue
}
case reflect.Interface:
return mergeBool(dval, reflect.ValueOf(fmt.Sprintf("%v", sval.Interface())))
default:
return ErrInvalidValue
}
@@ -303,6 +305,8 @@ func mergeString(dval reflect.Value, sval reflect.Value) error {
}
case reflect.String:
dval.SetString(sval.String())
case reflect.Interface:
return mergeString(dval, reflect.ValueOf(fmt.Sprintf("%v", sval.Interface())))
default:
return ErrInvalidValue
}
@@ -330,6 +334,8 @@ func mergeInt(dval reflect.Value, sval reflect.Value) error {
return err
}
dval.SetInt(l)
case reflect.Interface:
return mergeInt(dval, reflect.ValueOf(fmt.Sprintf("%v", sval.Interface())))
default:
return ErrInvalidValue
}
@@ -357,6 +363,8 @@ func mergeUint(dval reflect.Value, sval reflect.Value) error {
return err
}
dval.SetUint(l)
case reflect.Interface:
return mergeUint(dval, reflect.ValueOf(fmt.Sprintf("%v", sval.Interface())))
default:
return ErrInvalidValue
}
@@ -384,6 +392,8 @@ func mergeFloat(dval reflect.Value, sval reflect.Value) error {
return err
}
dval.SetFloat(l)
case reflect.Interface:
return mergeFloat(dval, reflect.ValueOf(fmt.Sprintf("%v", sval.Interface())))
default:
return ErrInvalidValue
}