From ca000fe740de46082bda3d70c5dade1559aa40d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Ma=C5=82ota-W=C3=B3jcik?= <43376657+wojciech-ridge@users.noreply.github.com> Date: Wed, 8 Jul 2020 10:23:27 +0200 Subject: [PATCH] add function for *http.Request (#1) --- generator/generator.go | 3 ++- types_gen.go | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/generator/generator.go b/generator/generator.go index 136cf43..330c6b3 100644 --- a/generator/generator.go +++ b/generator/generator.go @@ -47,8 +47,9 @@ package must import ( "io" "net" - "os" + "net/http" "net/url" + "os" ) `) diff --git a/types_gen.go b/types_gen.go index 3de976c..5368261 100644 --- a/types_gen.go +++ b/types_gen.go @@ -5,8 +5,9 @@ package must import ( "io" "net" - "os" + "net/http" "net/url" + "os" ) // Uint8 panics on error, returns the first argument otherwise @@ -290,3 +291,9 @@ func NetURL(arg *url.URL, err error) *url.URL { OK(err) return arg } + +// HTTPRequest panics on error, returns the first argument otherwise +func HTTPRequest(arg *http.Request, err error) *http.Request { + OK(err) + return arg +}