Doubt around "Test only public functions" concept

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
  • zerolog

    Zero Allocation JSON Logger

  • Hovewer it is not bad to export such a function, if it is done purely for convenience. For example github.com/rs/zerolog works on a logger instances, which can be created manually, but they also provide a github.com/rs/zerolog/blob//log package, which provide you access to the global logger which is more convenient in most cases

  • go

    The Go programming language

  • Take a look at the sort package in standard library. It tests the public interface to sort mainly, but it also does internal testing of the heapsort function (but they use the export_test.go trick to export the internal functions as external but only for testing). So it doesn't test only public functions but also internal functions (ignore the export_test thing for now).

  • 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