awesome-low-level-design icon indicating copy to clipboard operation
awesome-low-level-design copied to clipboard

Fix incorrect method definition in Car struct

Open chiranjeet-baruah opened this issue 6 months ago • 0 comments

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 DisplayInfo method was moved from being defined inside the Car struct to being defined as a method with Car as the receiver. This change ensures the method operates on a specific instance of Car and accesses its fields using the receiver variable c.

chiranjeet-baruah avatar Apr 25 '25 14:04 chiranjeet-baruah