Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dcarroll committed Oct 21, 2016
1 parent cda2103 commit 532eed8
Showing 1 changed file with 31 additions and 27 deletions.
58 changes: 31 additions & 27 deletions force.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"net/http"
"net/url"
"runtime"
"strings"
"strconv"
"strings"
)

const (
Expand Down Expand Up @@ -82,7 +82,7 @@ type ForceError struct {

type FieldName struct {
FieldName string
IsObject bool
IsObject bool
}

type SelectStruct struct {
Expand Down Expand Up @@ -666,15 +666,15 @@ func (f *Force) DecodeMe2(jsonStream string) (result ForceQueryResult) {
}
}
switch tokenType {
case "{":
if !recordsFound {
// This should be the start of the entire json
} else {
// Need to set a flag that in the next loop we are adding fields
// to a child object
}
default:
case "{":
if !recordsFound {
// This should be the start of the entire json
} else {
// Need to set a flag that in the next loop we are adding fields
// to a child object
}
default:

}
}
return
Expand Down Expand Up @@ -724,21 +724,21 @@ func (f *Force) DecodeMe(jsonStream string) (result *list.List) {
} else if token == "attributes" {
isAttributes = true
} else if tokenType != "json.Delim" && recordsFound && token != "attributes" && token != "url" {
//fmt.Printf("\ncase fieldName: %v.%v\n", SObjecttype, token)
spec := f.GetObjectSpec(SObjecttype, result)
//fmt.Printf("%v:", token)
t, err = dec.Token()
tt := fmt.Sprintf("%T", t)
//if /*t != nil &&*/ tt != "json.Delim" {
//fmt.Printf("%T\n", t)
f.PushFieldName(token, spec, (tt == "json.Delim" || t == nil))
/*if tt == "json.Number" {
fmt.Printf("Value: %#v\n", JSONNumberToString(t, ','))
} else {
fmt.Printf("Value: %s\n", t)
}*/
//}
//fmt.Printf("\n")
//fmt.Printf("\ncase fieldName: %v.%v\n", SObjecttype, token)
spec := f.GetObjectSpec(SObjecttype, result)
//fmt.Printf("%v:", token)
t, err = dec.Token()
tt := fmt.Sprintf("%T", t)
//if /*t != nil &&*/ tt != "json.Delim" {
//fmt.Printf("%T\n", t)
f.PushFieldName(token, spec, (tt == "json.Delim" || t == nil))
/*if tt == "json.Number" {
fmt.Printf("Value: %#v\n", JSONNumberToString(t, ','))
} else {
fmt.Printf("Value: %s\n", t)
}*/
//}
//fmt.Printf("\n")
} else {
if err != nil {
ErrorAndExit(err.Error())
Expand Down Expand Up @@ -781,7 +781,11 @@ func (f *Force) DumpListStack(l *list.List) {
fmt.Println(spec.ObjectName)
for _, v := range spec.FieldNames {
fmt.Printf("\t%v", v.FieldName)
if v.IsObject { fmt.Printf(" (Object)\n") } else { fmt.Printf("\n") }
if v.IsObject {
fmt.Printf(" (Object)\n")
} else {
fmt.Printf("\n")
}
}
}
fmt.Printf("\n\n")
Expand Down

0 comments on commit 532eed8

Please sign in to comment.