-
Notifications
You must be signed in to change notification settings - Fork 118
Upgrading from v1.x to v2.0.0
Markus edited this page May 8, 2020
·
4 revisions
-
go get -u github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs -
replace all imports of
github.com/markus-wa/demoinfocs-golang{/...}withgithub.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs{/...}github.com/markus-wa/demoinfocs-golang -> github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocsgithub.com/markus-wa/demoinfocs-golang/common -> github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/common...
-
delete
github.com/markus-wa/demoinfocs-golang v1.x.xfromgo.mod -
run
go buildto find compilation errors -
fix according to change log / common errors are below
-
profit 🎉
./csminify.go:86:28: cannot use p (type demoinfocs.Parser) as type *demoinfocs.Parser in assignment:
*demoinfocs.Parser is pointer to interface, not interface
change *demoinfocs.Parser -> demoinfocs.Parser
./events.go:104:46: e.Weapon.Weapon undefined (type *common.Equipment has no field or method Weapon)
change e.Weapon.Weapon -> e.Weapon.Type
./csminify.go:158:5: cannot use player.Armor (type func() int) as type int in field value
change player.Armor -> player.Armor()
./csminify.go:158:22: player.Hp undefined (type *common.Player has no field or method Hp)
change player.Hp -> player.Health()