Passing an explicitly nil flag value in a Cobra CLI app

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

    A Commander for modern Go CLI interactions

  • I'm building a CLI app using Cobra. It's mostly CRUD stuff and I'm currently working on the "U" functionality. In this case, I'm updating a user. When I create the user, I have a number of flags that can be optional because I can set reasonable default values. If you send a flag, the value you send is used; if you don't, the "reasonable default" is applied. Pretty straightforward.

  • 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