SkillAgentSearch skills...

Mockhttp

Mock object for Go http.ResponseWriter

Install / Use

/learn @tv42/Mockhttp
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

mockhttp -- Go package for unit testing HTTP serving

Unit testing HTTP services written in Go means you need to call their ServeHTTP receiver. For this, you need something that fulfills the http.ResponseWriter interface, and you need to populate a http.Request struct with suitable-looking data. mockhttp.go helps you do these tasks, without excessive copy-pasting.

See mockhttp_test.go for an example of usage.

Related Skills

View on GitHub
GitHub Stars23
CategoryDevelopment
Updated2y ago
Forks6

Languages

Go

Security Score

75/100

Audited on Nov 14, 2023

No findings