Skip to content

Commit

Permalink
Merge pull request #49 from webability-go/late-night
Browse files Browse the repository at this point in the history
patch v0.3.1
  • Loading branch information
metalwolf committed Feb 9, 2020
2 parents 3904136 + f0fc6eb commit 26e3399
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions xdataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ func (d *XDataset) Get(key string) (interface{}, bool) {
if !ok {
return nil, false
}
switch subset.(type) {
case XDatasetDef:
return (subset.(XDatasetDef)).Get(strings.Join(xid[1:], ">"))
case XDatasetCollectionDef:
if ds, ok := subset.(XDatasetDef); ok {
return ds.Get(strings.Join(xid[1:], ">"))
}
if dsc, ok := subset.(XDatasetCollectionDef); ok {
entry, err := strconv.Atoi(xid[1])
if err != nil {
return nil, false
}
ds, _ := (subset.(XDatasetCollectionDef)).Get(entry)
ds, _ := dsc.Get(entry)
if ds == nil {
return nil, false
}
Expand Down
4 changes: 2 additions & 2 deletions xdataset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

func ExampleXDataset() {

tmp, _ := time.Parse("2020-01-01T12:00:00", time.RFC3339)
tmp, _ := time.Parse(time.RFC3339, "2020-01-01T12:00:00")
data := XDataset{
"clientname": "Fred",
"clientpicture": "face.jpg",
Expand All @@ -34,7 +34,7 @@ func ExampleXDataset() {

func TestXDataset(t *testing.T) {

tmp, _ := time.Parse("2020-01-01T12:00:00", time.RFC3339)
tmp, _ := time.Parse(time.RFC3339, "2020-01-01T12:00:00")
data := XDataset{
"clientname": "Fred",
"clientpicture": "face.jpg",
Expand Down
2 changes: 1 addition & 1 deletion xtemplate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ No hobbies
log.Fatal("Error: template could not compile")
}

tmp, _ := time.Parse("2020-01-01T12:00:00", time.RFC3339)
tmp, _ := time.Parse(time.RFC3339, "2020-01-01T12:00:00")
lang := NewXLanguage("mainpage", language.English)
lang.Set("welcome", "Welcome to you")
data := XDataset{
Expand Down

0 comments on commit 26e3399

Please sign in to comment.