Skip to content

Upgrading from v1.x to v2.0.0

Markus edited this page May 8, 2020 · 4 revisions
  1. go get -u github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs

  2. replace all imports of github.com/markus-wa/demoinfocs-golang{/...} with github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs{/...}

    github.com/markus-wa/demoinfocs-golang -> github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs

    github.com/markus-wa/demoinfocs-golang/common -> github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/common

    ...

  3. delete github.com/markus-wa/demoinfocs-golang v1.x.x from go.mod

  4. run go build to find compilation errors

  5. fix according to change log / common errors are below

  6. profit 🎉

Common Errors

./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


./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()

Clone this wiki locally