-
Notifications
You must be signed in to change notification settings - Fork 117
Upgrading from v1.x to v2.0.0
-
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:110:17: undefined: demoinfocs.IParser
change demoinfocs.IParser -> demoinfocs.Parser
./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
./csminify.go:110:17: undefined: demoinfocs.IGameState
change demoinfocs.IGameState -> demoinfocs.GameState
./csminify.go:86:28: cannot use gs (type demoinfocs.GameState) as type *demoinfocs.GameState in assignment:
*demoinfocs.GameState is pointer to interface, not interface
change *demoinfocs.GameState -> demoinfocs.GameState
./csminify.go:110:17: undefined: demoinfocs.IParticipants
change demoinfocs.IParticipants -> demoinfocs.Participants
./csminify.go:86:28: cannot use p (type demoinfocs.Participants) as type *demoinfocs.Participants in assignment:
*demoinfocs.Participants is pointer to interface, not interface
change *demoinfocs.Participants -> demoinfocs.Participants
./csminify.go:110:17: undefined: sendtables.IEntity
change sendtables.IEntity -> sendtables.Entity
./csminify.go:86:28: cannot use entity (type sendtables.Entity) as type *sendtables.Entity in assignment:
*sendtables.Entity is pointer to interface, not interface
change *sendtables.Entity -> sendtables.Entity
./csminify.go:110:17: undefined: sendtables.IProperty
change sendtables.IProperty -> sendtables.Property
./csminify.go:86:28: cannot use entity (type sendtables.Property) as type *sendtables.Property in assignment:
*sendtables.Property is pointer to interface, not interface
change *sendtables.Property -> sendtables.Property
./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()
./csminify.go:157:16: player.SteamID undefined (type *common.Player has no field or method SteamID)
change player.SteamID -> player.SteamID64
./main.go:86:13: player.AdditionalPlayerInformation undefined (type *common.Player has no field or method AdditionalPlayerInformation)
change player.AdditionalPlayerInformation.Kills -> player.Kills()
change player.AdditionalPlayerInformation.Deaths -> player.Deaths()
change player.AdditionalPlayerInformation.Assists -> player.Assists()
etc.
./csminify.go:157:23: player.Entity.FindPropertyI undefined (type sendtables.Entity has no field or method FindPropertyI)
change player.Entity.FindPropertyI() -> player.Entity.Property()
./csminify.go:157:23: player.Entity.PropertiesI undefined (type sendtables.Entity has no field or method PropertiesI)
change player.Entity.PropertiesI() -> player.Entity.Properties()