-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Milestone
Description
Go does encourage use of generated code by using go generate and the respective //go:generate build comments.
Working with implementing optional interfaces that a go object might chose to provide to extend a base interface type at runtime, I've come across the need to write long build comments like https://github.com/andig/evcc/blob/master/internal/vehicle/vehicle.go#L28
For readability it would be great if these could be supplied as multi-line comment. This could look like this:
//go:generate go run ../../cmd/tools/decorate.go
//-p vehicle -f decorateVehicle -b api.Vehicle -o vehicle_decorators
//-t "api.ChargeState,Status,func() (api.ChargeStatus, error)"
//-t "api.VehicleRange,Range,func() (int64, error)"
I would like to propose to allow multi-line comments, given that the comment marker // is not followed by a space ( ).
seankhliao