remove old patch method
This commit is contained in:
parent
0cd2bcd4e9
commit
542c2850a7
|
@ -98,23 +98,3 @@ func (f *FeedResponse) Patch(instr *instruction) {
|
|||
if err != nil {
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Play) Patch(patch Patch) {
|
||||
instructions := patch.Diff
|
||||
stem := "/liveData/plays/currentPlay"
|
||||
for _, i := range instructions {
|
||||
if i.Op == "add" && i.Path == stem+"/result/description" {
|
||||
p.Result.Description = i.Value.(string)
|
||||
} else if i.Op == "replace" && i.Path == stem+"/about/isScoringPlay" {
|
||||
p.About.IsScoringPlay = i.Value.(bool)
|
||||
} else if i.Op == "replace" && i.Path == stem+"/result/homeScore" {
|
||||
p.Result.HomeScore = int(i.Value.(float64))
|
||||
} else if i.Op == "replace" && i.Path == stem+"/result/awayScore" {
|
||||
p.Result.AwayScore = int(i.Value.(float64))
|
||||
} else if i.Op == "add" && i.Path == stem+"/result/event" {
|
||||
p.Result.Event = i.Value.(string)
|
||||
} else if i.Op == "replace" && i.Path == stem+"/atBatIndex" {
|
||||
p.AtBatIndex = int(i.Value.(float64))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue