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: ajg/form
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: gostack/form
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Jan 12, 2015

  1. Copy the full SHA
    8be7135 View commit details
  2. Fix decode

    divoxx committed Jan 12, 2015
    Copy the full SHA
    b464f15 View commit details
Showing with 6 additions and 6 deletions.
  1. +6 −6 decode.go
12 changes: 6 additions & 6 deletions decode.go
Original file line number Diff line number Diff line change
@@ -118,12 +118,12 @@ func decodeStruct(v reflect.Value, x interface{}) {
for k, c := range getNode(x) {
if f, ok := findField(v, k); !ok && k == "" {
panic(getString(x) + " cannot be decoded as struct " + t.String())
} else if !ok {
panic(k + " doesn't exist in struct " + t.String())
} else if !f.CanSet() {
panic(k + " cannot be set in struct " + t.String())
} else {
decodeValue(f, c)
} else if ok {
if !f.CanSet() {
panic(k + " cannot be set in struct " + t.String())
} else {
decodeValue(f, c)
}
}
}
}