Skip to content

Returning value types rather than pointers #174

@peteski22

Description

@peteski22

Why are you returning an empty ServerEntry struct instead of nil?

Originally posted by @dpoulopoulos in #173

There are places in the existing code base where we should consider returning a value type over a pointer...

e.g. DefaultCacheTTL and transformValueArg

But also, some places that should likely stay as they are, returning a pointer:

  • NewHealthTracker
  • NewClientManager
  • NewExecutionContextConfig
  • NewCLIArgParser

Because they manage a lot of state or deal with large structs.


Refactor the following to return value types not pointers:

  • DefaultCacheTTL
  • transformValueArg

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions