What is the proper (or conventional) way to deal with the fact that interface type parameters to a function can be nil?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • fx

    A dependency injection based application framework for Go. (by uber-go)

  • I agree here. Would like to add that the example you provided is a clear example of dependency injection. If you implement dependency injection in a consistent manner always passing the dependencies in the constructor functions, you can consistently check in those functions if your dependencies are nil. Also, some dependency injection libraries will do this for you when booting up your program, for example, UberFX.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts