cloudfoundry / go-pubsub

Tree based pubsub library for Go.
Apache License 2.0
57 stars 7 forks source link

deadcode in generated code #3

Open jasonkeene opened 6 years ago

jasonkeene commented 6 years ago

I was doing a bit of housekeeping and noticed this in loggregator:

deadcode: router/internal/server/v2/envelope_traverser.gen.go:20:1: hashBool is unused
deadcode: router/internal/server/v2/envelope_traverser.gen.go:94:1: _Message_Envelope_Log is unused
deadcode: router/internal/server/v2/envelope_traverser.gen.go:106:1: ___Message_Envelope_Log_Log is unused
deadcode: router/internal/server/v2/envelope_traverser.gen.go:123:1: _Message_Envelope_Log_Log is unused
deadcode: router/internal/server/v2/envelope_traverser.gen.go:146:1: _Message_Envelope_Counter is unused
deadcode: router/internal/server/v2/envelope_traverser.gen.go:158:1: ___Message_Envelope_Counter_Counter is unused
deadcode: router/internal/server/v2/envelope_traverser.gen.go:175:1: _Message_Envelope_Counter_Counter is unused
deadcode: router/internal/server/v2/envelope_traverser.gen.go:198:1: _Message_Envelope_Gauge is unused
deadcode: router/internal/server/v2/envelope_traverser.gen.go:210:1: ___Message_Envelope_Gauge_Gauge is unused
deadcode: router/internal/server/v2/envelope_traverser.gen.go:227:1: _Message_Envelope_Gauge_Gauge is unused
deadcode: router/internal/server/v2/envelope_traverser.gen.go:250:1: _Message_Envelope_Timer is unused
deadcode: router/internal/server/v2/envelope_traverser.gen.go:262:1: ___Message_Envelope_Timer_Timer is unused
deadcode: router/internal/server/v2/envelope_traverser.gen.go:279:1: _Message_Envelope_Timer_Timer is unused
deadcode: router/internal/server/v2/envelope_traverser.gen.go:302:1: _Message_Envelope_Event is unused
deadcode: router/internal/server/v2/envelope_traverser.gen.go:314:1: ___Message_Envelope_Event_Event is unused
deadcode: router/internal/server/v2/envelope_traverser.gen.go:330:1: _Message_Envelope_Event_Event is unused

It seems to also be in the examples:

deadcode: examples/structs/gen_struct.go:18:1: hashBool is unused
deadcode: examples/structs/gen_struct.go:97:1: _w is unused
deadcode: examples/structs/gen_struct.go:150:1: _x is unused
cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/153236766

The labels on this github issue will be updated when the story is started.

poy commented 6 years ago

The generator needs work. It does the simplest thing for now and that means generating dead code.