awesome-low-level-design
awesome-low-level-design copied to clipboard
Fix incorrect method definition in Car struct
This pull request refactors the DisplayInfo method in the Car struct to use a receiver, improving clarity and adhering to Go's conventions for defining methods on structs.
Changes to method definition:
- The
DisplayInfomethod was moved from being defined inside theCarstruct to being defined as a method withCaras the receiver. This change ensures the method operates on a specific instance ofCarand accesses its fields using the receiver variablec.