19 best Go Unit Testing libraries in 2024

share link

by marketing.admin@openweaver.com dot icon Updated: Mar 10, 2023

technology logo
technology logo

Guide Kit Guide Kit  

Unit testing is a component of test-driven development (TDD), a pragmatic methodology that takes a meticulous approach to build a product by means of continual testing and revision. In TDD, test cases are initially created by the developer before they start developing their application. This method of test can be applied virtually to every level of software testing: unit, integration, system and acceptance. In this list, we've rounded up 19 good Open Source libraries that you can use in your projects now. Top libraries include goreporter - Golang tool that does static analysis, unit testing, code review; gomonkey - make monkey patching in unit tests easy; keploy - No code API testing platform Create unit tests and data mocks from API calls.

goreporterby 360EntSecGroup-Skylar

Go doticonstar image 2867 doticonVersion:version3.0.2doticon
License: Permissive (Apache-2.0)

A Golang tool that does static analysis, unit testing, code review and generate code quality report.

Support
    Quality
      Security
        License
          Reuse

            goreporterby 360EntSecGroup-Skylar

            Go doticon star image 2867 doticonVersion:version3.0.2doticon License: Permissive (Apache-2.0)

            A Golang tool that does static analysis, unit testing, code review and generate code quality report.
            Support
              Quality
                Security
                  License
                    Reuse

                      gomonkeyby agiledragon

                      Go doticonstar image 1542 doticonVersion:v2.10.0doticon
                      License: Permissive (MIT)

                      gomonkey is a library to make monkey patching in unit tests easy

                      Support
                        Quality
                          Security
                            License
                              Reuse

                                gomonkeyby agiledragon

                                Go doticon star image 1542 doticonVersion:v2.10.0doticon License: Permissive (MIT)

                                gomonkey is a library to make monkey patching in unit tests easy
                                Support
                                  Quality
                                    Security
                                      License
                                        Reuse

                                          keployby keploy

                                          Go doticonstar image 2002 doticonVersion:v0.9.1doticon
                                          License: Permissive (Apache-2.0)

                                          Test generation for Developers. Generate tests and stubs for your application that actually works!

                                          Support
                                            Quality
                                              Security
                                                License
                                                  Reuse

                                                    keployby keploy

                                                    Go doticon star image 2002 doticonVersion:v0.9.1doticon License: Permissive (Apache-2.0)

                                                    Test generation for Developers. Generate tests and stubs for your application that actually works!
                                                    Support
                                                      Quality
                                                        Security
                                                          License
                                                            Reuse

                                                              test2docby adams-sarah

                                                              Go doticonstar image 330 doticonVersion:Currentdoticon
                                                              License: Permissive (MIT)

                                                              Generate documentation for your REST/HTTP API from your Go unit tests

                                                              Support
                                                                Quality
                                                                  Security
                                                                    License
                                                                      Reuse

                                                                        test2docby adams-sarah

                                                                        Go doticon star image 330 doticonVersion:Currentdoticon License: Permissive (MIT)

                                                                        Generate documentation for your REST/HTTP API from your Go unit tests
                                                                        Support
                                                                          Quality
                                                                            Security
                                                                              License
                                                                                Reuse

                                                                                  gostubby prashantv

                                                                                  Go doticonstar image 210 doticonVersion:v1.1.0doticon
                                                                                  License: Permissive (MIT)

                                                                                  gostub is a library to make stubbing in unit tests easy

                                                                                  Support
                                                                                    Quality
                                                                                      Security
                                                                                        License
                                                                                          Reuse

                                                                                            gostubby prashantv

                                                                                            Go doticon star image 210 doticonVersion:v1.1.0doticon License: Permissive (MIT)

                                                                                            gostub is a library to make stubbing in unit tests easy
                                                                                            Support
                                                                                              Quality
                                                                                                Security
                                                                                                  License
                                                                                                    Reuse

                                                                                                      redigomockby rafaeljusto

                                                                                                      Go doticonstar image 197 doticonVersion:v2.1doticon
                                                                                                      License: Strong Copyleft (GPL-2.0)

                                                                                                      Easy way to unit test projects using redigo library (Redis client in go)

                                                                                                      Support
                                                                                                        Quality
                                                                                                          Security
                                                                                                            License
                                                                                                              Reuse

                                                                                                                redigomockby rafaeljusto

                                                                                                                Go doticon star image 197 doticonVersion:v2.1doticon License: Strong Copyleft (GPL-2.0)

                                                                                                                Easy way to unit test projects using redigo library (Redis client in go)
                                                                                                                Support
                                                                                                                  Quality
                                                                                                                    Security
                                                                                                                      License
                                                                                                                        Reuse

                                                                                                                          trans-dslby agiledragon

                                                                                                                          Go doticonstar image 59 doticonVersion:Currentdoticon
                                                                                                                          License: Permissive (MIT)

                                                                                                                          a transaction model framework, seems simple but powerful

                                                                                                                          Support
                                                                                                                            Quality
                                                                                                                              Security
                                                                                                                                License
                                                                                                                                  Reuse

                                                                                                                                    trans-dslby agiledragon

                                                                                                                                    Go doticon star image 59 doticonVersion:Currentdoticon License: Permissive (MIT)

                                                                                                                                    a transaction model framework, seems simple but powerful
                                                                                                                                    Support
                                                                                                                                      Quality
                                                                                                                                        Security
                                                                                                                                          License
                                                                                                                                            Reuse

                                                                                                                                              autobldby prashantv

                                                                                                                                              Go doticonstar image 41 doticonVersion:Currentdoticon
                                                                                                                                              License: Strong Copyleft (GPL-2.0)

                                                                                                                                              Utility to automatically recompile your server application when changes are made to your source code.

                                                                                                                                              Support
                                                                                                                                                Quality
                                                                                                                                                  Security
                                                                                                                                                    License
                                                                                                                                                      Reuse

                                                                                                                                                        autobldby prashantv

                                                                                                                                                        Go doticon star image 41 doticonVersion:Currentdoticon License: Strong Copyleft (GPL-2.0)

                                                                                                                                                        Utility to automatically recompile your server application when changes are made to your source code.
                                                                                                                                                        Support
                                                                                                                                                          Quality
                                                                                                                                                            Security
                                                                                                                                                              License
                                                                                                                                                                Reuse

                                                                                                                                                                  go-sdkby keploy

                                                                                                                                                                  Go doticonstar image 34 doticonVersion:v0.8.8doticon
                                                                                                                                                                  License: Permissive (Apache-2.0)

                                                                                                                                                                  Official Keploy Go SDK 🔵

                                                                                                                                                                  Support
                                                                                                                                                                    Quality
                                                                                                                                                                      Security
                                                                                                                                                                        License
                                                                                                                                                                          Reuse

                                                                                                                                                                            go-sdkby keploy

                                                                                                                                                                            Go doticon star image 34 doticonVersion:v0.8.8doticon License: Permissive (Apache-2.0)

                                                                                                                                                                            Official Keploy Go SDK 🔵
                                                                                                                                                                            Support
                                                                                                                                                                              Quality
                                                                                                                                                                                Security
                                                                                                                                                                                  License
                                                                                                                                                                                    Reuse

                                                                                                                                                                                      ddd-sample-in-golangby agiledragon

                                                                                                                                                                                      Go doticonstar image 25 doticonVersion:Currentdoticon
                                                                                                                                                                                      License: Permissive (MIT)

                                                                                                                                                                                      Support
                                                                                                                                                                                        Quality
                                                                                                                                                                                          Security
                                                                                                                                                                                            License
                                                                                                                                                                                              Reuse

                                                                                                                                                                                                ddd-sample-in-golangby agiledragon

                                                                                                                                                                                                Go doticon star image 25 doticonVersion:Currentdoticon License: Permissive (MIT)

                                                                                                                                                                                                Support
                                                                                                                                                                                                  Quality
                                                                                                                                                                                                    Security
                                                                                                                                                                                                      License
                                                                                                                                                                                                        Reuse

                                                                                                                                                                                                          go-gender-statsby adams-sarah

                                                                                                                                                                                                          Go doticonstar image 12 doticonVersion:Currentdoticon
                                                                                                                                                                                                          License: Permissive (MIT)

                                                                                                                                                                                                          Pull golang contributors + gophers slack members, predict gender of each first name, print gender stats

                                                                                                                                                                                                          Support
                                                                                                                                                                                                            Quality
                                                                                                                                                                                                              Security
                                                                                                                                                                                                                License
                                                                                                                                                                                                                  Reuse

                                                                                                                                                                                                                    go-gender-statsby adams-sarah

                                                                                                                                                                                                                    Go doticon star image 12 doticonVersion:Currentdoticon License: Permissive (MIT)

                                                                                                                                                                                                                    Pull golang contributors + gophers slack members, predict gender of each first name, print gender stats
                                                                                                                                                                                                                    Support
                                                                                                                                                                                                                      Quality
                                                                                                                                                                                                                        Security
                                                                                                                                                                                                                          License
                                                                                                                                                                                                                            Reuse

                                                                                                                                                                                                                              etceteraby rafaeljusto

                                                                                                                                                                                                                              Go doticonstar image 10 doticonVersion:v0.1.0doticon
                                                                                                                                                                                                                              License: Permissive (MIT)

                                                                                                                                                                                                                              etcd client that uses a tagged struct to save and load values

                                                                                                                                                                                                                              Support
                                                                                                                                                                                                                                Quality
                                                                                                                                                                                                                                  Security
                                                                                                                                                                                                                                    License
                                                                                                                                                                                                                                      Reuse

                                                                                                                                                                                                                                        etceteraby rafaeljusto

                                                                                                                                                                                                                                        Go doticon star image 10 doticonVersion:v0.1.0doticon License: Permissive (MIT)

                                                                                                                                                                                                                                        etcd client that uses a tagged struct to save and load values
                                                                                                                                                                                                                                        Support
                                                                                                                                                                                                                                          Quality
                                                                                                                                                                                                                                            Security
                                                                                                                                                                                                                                              License
                                                                                                                                                                                                                                                Reuse
                                                                                                                                                                                                                                                  Go doticonstar image 3 doticonVersion:Currentdoticon
                                                                                                                                                                                                                                                  License: Permissive (Apache-2.0)

                                                                                                                                                                                                                                                  Sample application to understand keploy integration

                                                                                                                                                                                                                                                  Support
                                                                                                                                                                                                                                                    Quality
                                                                                                                                                                                                                                                      Security
                                                                                                                                                                                                                                                        License
                                                                                                                                                                                                                                                          Reuse

                                                                                                                                                                                                                                                            example-url-shortenerby keploy

                                                                                                                                                                                                                                                            Go doticon star image 3 doticonVersion:Currentdoticon License: Permissive (Apache-2.0)

                                                                                                                                                                                                                                                            Sample application to understand keploy integration
                                                                                                                                                                                                                                                            Support
                                                                                                                                                                                                                                                              Quality
                                                                                                                                                                                                                                                                Security
                                                                                                                                                                                                                                                                  License
                                                                                                                                                                                                                                                                    Reuse

                                                                                                                                                                                                                                                                      protectmemby prashantv

                                                                                                                                                                                                                                                                      Go doticonstar image 2 doticonVersion:Currentdoticon
                                                                                                                                                                                                                                                                      License: Permissive (MIT)

                                                                                                                                                                                                                                                                      A Golang library to allocate memory that can have access protection changed after allocation

                                                                                                                                                                                                                                                                      Support
                                                                                                                                                                                                                                                                        Quality
                                                                                                                                                                                                                                                                          Security
                                                                                                                                                                                                                                                                            License
                                                                                                                                                                                                                                                                              Reuse

                                                                                                                                                                                                                                                                                protectmemby prashantv

                                                                                                                                                                                                                                                                                Go doticon star image 2 doticonVersion:Currentdoticon License: Permissive (MIT)

                                                                                                                                                                                                                                                                                A Golang library to allocate memory that can have access protection changed after allocation
                                                                                                                                                                                                                                                                                Support
                                                                                                                                                                                                                                                                                  Quality
                                                                                                                                                                                                                                                                                    Security
                                                                                                                                                                                                                                                                                      License
                                                                                                                                                                                                                                                                                        Reuse

                                                                                                                                                                                                                                                                                          gostubby mokiat

                                                                                                                                                                                                                                                                                          Go doticonstar image 2 doticonVersion:v1.3.0doticon
                                                                                                                                                                                                                                                                                          License: Permissive (Apache-2.0)

                                                                                                                                                                                                                                                                                          Stubbing framework for the Go Language

                                                                                                                                                                                                                                                                                          Support
                                                                                                                                                                                                                                                                                            Quality
                                                                                                                                                                                                                                                                                              Security
                                                                                                                                                                                                                                                                                                License
                                                                                                                                                                                                                                                                                                  Reuse

                                                                                                                                                                                                                                                                                                    gostubby mokiat

                                                                                                                                                                                                                                                                                                    Go doticon star image 2 doticonVersion:v1.3.0doticon License: Permissive (Apache-2.0)

                                                                                                                                                                                                                                                                                                    Stubbing framework for the Go Language
                                                                                                                                                                                                                                                                                                    Support
                                                                                                                                                                                                                                                                                                      Quality
                                                                                                                                                                                                                                                                                                        Security
                                                                                                                                                                                                                                                                                                          License
                                                                                                                                                                                                                                                                                                            Reuse

                                                                                                                                                                                                                                                                                                              paginationby muhlemmer

                                                                                                                                                                                                                                                                                                              Go doticonstar image 2 doticonVersion:V0.1doticon
                                                                                                                                                                                                                                                                                                              License: Permissive (BSD-3-Clause)

                                                                                                                                                                                                                                                                                                              Pagination is a small Go library for setting up a range with data for use in a template.

                                                                                                                                                                                                                                                                                                              Support
                                                                                                                                                                                                                                                                                                                Quality
                                                                                                                                                                                                                                                                                                                  Security
                                                                                                                                                                                                                                                                                                                    License
                                                                                                                                                                                                                                                                                                                      Reuse

                                                                                                                                                                                                                                                                                                                        paginationby muhlemmer

                                                                                                                                                                                                                                                                                                                        Go doticon star image 2 doticonVersion:V0.1doticon License: Permissive (BSD-3-Clause)

                                                                                                                                                                                                                                                                                                                        Pagination is a small Go library for setting up a range with data for use in a template.
                                                                                                                                                                                                                                                                                                                        Support
                                                                                                                                                                                                                                                                                                                          Quality
                                                                                                                                                                                                                                                                                                                            Security
                                                                                                                                                                                                                                                                                                                              License
                                                                                                                                                                                                                                                                                                                                Reuse

                                                                                                                                                                                                                                                                                                                                  strong-passwordby agiledragon

                                                                                                                                                                                                                                                                                                                                  Go doticonstar image 1 doticonVersion:Currentdoticon
                                                                                                                                                                                                                                                                                                                                  License: Permissive (MIT)

                                                                                                                                                                                                                                                                                                                                  Support
                                                                                                                                                                                                                                                                                                                                    Quality
                                                                                                                                                                                                                                                                                                                                      Security
                                                                                                                                                                                                                                                                                                                                        License
                                                                                                                                                                                                                                                                                                                                          Reuse

                                                                                                                                                                                                                                                                                                                                            strong-passwordby agiledragon

                                                                                                                                                                                                                                                                                                                                            Go doticon star image 1 doticonVersion:Currentdoticon License: Permissive (MIT)

                                                                                                                                                                                                                                                                                                                                            Support
                                                                                                                                                                                                                                                                                                                                              Quality
                                                                                                                                                                                                                                                                                                                                                Security
                                                                                                                                                                                                                                                                                                                                                  License
                                                                                                                                                                                                                                                                                                                                                    Reuse

                                                                                                                                                                                                                                                                                                                                                      sample-goby keploy

                                                                                                                                                                                                                                                                                                                                                      Go doticonstar image 1 doticonVersion:Currentdoticon
                                                                                                                                                                                                                                                                                                                                                      License: Permissive (Apache-2.0)

                                                                                                                                                                                                                                                                                                                                                      Keploy Go SDK samples

                                                                                                                                                                                                                                                                                                                                                      Support
                                                                                                                                                                                                                                                                                                                                                        Quality
                                                                                                                                                                                                                                                                                                                                                          Security
                                                                                                                                                                                                                                                                                                                                                            License
                                                                                                                                                                                                                                                                                                                                                              Reuse

                                                                                                                                                                                                                                                                                                                                                                sample-goby keploy

                                                                                                                                                                                                                                                                                                                                                                Go doticon star image 1 doticonVersion:Currentdoticon License: Permissive (Apache-2.0)

                                                                                                                                                                                                                                                                                                                                                                Keploy Go SDK samples
                                                                                                                                                                                                                                                                                                                                                                Support
                                                                                                                                                                                                                                                                                                                                                                  Quality
                                                                                                                                                                                                                                                                                                                                                                    Security
                                                                                                                                                                                                                                                                                                                                                                      License
                                                                                                                                                                                                                                                                                                                                                                        Reuse
                                                                                                                                                                                                                                                                                                                                                                          Go doticonstar image 1 doticonVersion:v1.0.0doticon
                                                                                                                                                                                                                                                                                                                                                                          License: Permissive (Apache-2.0)

                                                                                                                                                                                                                                                                                                                                                                          Go integration for faucet-pipeline

                                                                                                                                                                                                                                                                                                                                                                          Support
                                                                                                                                                                                                                                                                                                                                                                            Quality
                                                                                                                                                                                                                                                                                                                                                                              Security
                                                                                                                                                                                                                                                                                                                                                                                License
                                                                                                                                                                                                                                                                                                                                                                                  Reuse

                                                                                                                                                                                                                                                                                                                                                                                    faucet-pipeline-goby REABMAX

                                                                                                                                                                                                                                                                                                                                                                                    Go doticon star image 1 doticonVersion:v1.0.0doticon License: Permissive (Apache-2.0)

                                                                                                                                                                                                                                                                                                                                                                                    Go integration for faucet-pipeline
                                                                                                                                                                                                                                                                                                                                                                                    Support
                                                                                                                                                                                                                                                                                                                                                                                      Quality
                                                                                                                                                                                                                                                                                                                                                                                        Security
                                                                                                                                                                                                                                                                                                                                                                                          License
                                                                                                                                                                                                                                                                                                                                                                                            Reuse

                                                                                                                                                                                                                                                                                                                                                                                              See similar Kits and Libraries