Golang panics in libraries

This page summarizes the projects mentioned and recommended in the original post on dev.to

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

    errcheck checks that you checked errors.

  • And we also expect that the caller will check the error and handle it. There is a popular linter that checks it for us: errcheck.

  • rust

    Empowering everyone to build reliable and efficient software.

  • In case of modern languages like Golang, Rust, etc. we have a predefined way to work with error handling by specific error types and rules on how to use them. It improves readability and simplifies interfaces of functions.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • CPython

    The Python programming language

  • The main idea of this approach is to throw an error from a function up to callers stack until someone will catch it. This way is the most popular way to handle errors in languages with exceptions like Java, PHP, Python, Ruby, etc.

  • PHPT

    The PHP Interpreter

  • With Go it is a bit different. We do not have exceptions, but we have panic and recover functions. Panics by themself are not control-flow statements, they are closer to Java Error type or PHP ErrorException type. They are used to stop execution of the program in case of critical errors that are not related to business flow of the program. In case of Go we can use panic to throw an error and recover to catch it, but we can catch it only in defer functions that are not linear execution code block and applies some limitations on top of it.

  • golang-docker

    Docker Official Image packaging for golang

  • With Go it is a bit different. We do not have exceptions, but we have panic and recover functions. Panics by themself are not control-flow statements, they are closer to Java Error type or PHP ErrorException type. They are used to stop execution of the program in case of critical errors that are not related to business flow of the program. In case of Go we can use panic to throw an error and recover to catch it, but we can catch it only in defer functions that are not linear execution code block and applies some limitations on top of it.

  • 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