Testing calls to external APIs

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

Our great sponsors
  • InfluxDB - Access the most powerful time series database as a service
  • SonarLint - Clean code begins in your IDE with SonarLint
  • SaaSHub - Software Alternatives and Reviews
  • go-gitlab

    GitLab Go SDK

    I list my Gitlab projects with https://github.com/xanzy/go-gitlab, and in a test I wrote for the method listing and displaying my projects, I create a mock http server, that responds by returning the json response of a call to the Gitlab API.

  • gock

    HTTP traffic mocking and testing made easy in Go ༼ʘ̚ل͜ʘ̚༽

    Mocking the http client with explicit responses; for example using h2non/gock

  • InfluxDB

    Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.

  • go-vcr

    Record and replay your HTTP interactions for fast, deterministic and accurate tests

    Mocking the http client using recorded responses; for example using dnaeon/go-vcr

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