Registry / testing / appleboy-gofight

appleboy-gofight

JSON →
library2.0.0+incompatiblegogounverified

Package gofight offers a simple API for HTTP handler testing in Go frameworks.

go get github.com/appleboy/gofight
INSTALL
IMPORT
SIG · APPLEBOY-GOFIGHT
A
appleboy-gofight
testinggov2.0.0+incompatible
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

gofight
github.com/appleboy/gofight

Tests an HTTP handler with custom headers and prints the response body.

package main import ( "fmt" "net/http" "github.com/appleboy/gofight" ) func helloHandler(w http.ResponseWriter, r *http.Request) { w.Write([]byte("hello")) } func main() { r := gofight.New() r.GET("/"). SetHeader(map[string]string{"X-Test": "true"}). Run(helloHandler, func(r gofight.HTTPResponse, rq gofight.HTTPRequest) { fmt.Println(r.Body.String()) }) }
Debug
Known issues
gotchaVersion 2.0.0+incompatible uses a major version suffix that may cause import path issues with Go modules.
fix
Use gofight v1.x or ensure your go.mod requires v2.0.0+incompatible explicitly.
affects: >=2.0.0
Upgrade
Version history
2.0.0+incompatiblelatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
45 hits · last 30 days
node
40
Resources
appleboy-gofight — go get appleboy-gofight · libregistry