Skip to content

Commit

Permalink
fix: use errors.New
Browse files Browse the repository at this point in the history
  • Loading branch information
ikadix committed Jul 2, 2024
1 parent 369d05d commit ef931e8
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
3 changes: 2 additions & 1 deletion next/core/core.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion next/public/public.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion next/templates/client.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const (
)

var (
ErrRequestFailed = fmt.Errorf("request was not successful")
ErrRequestFailed = errors.New("request was not successful")
)

// RequestEditorFn is the function signature for the RequestEditor callback function
Expand Down
50 changes: 50 additions & 0 deletions next/templates/imports.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{{- if opts.Generate.StdHTTPServer}}//go:build go1.22

{{- end}}
// Package {{.PackageName}} provides primitives to interact with the openapi HTTP API.
//
// Code generated by {{.ModuleName}} version {{.Version}} DO NOT EDIT.
package {{.PackageName}}

import (
"bytes"
"compress/gzip"
"context"
"encoding/base64"
"encoding/json"
"encoding/xml"
"errors"
"fmt"
"gopkg.in/yaml.v2"
"io"
"os"
"mime"
"mime/multipart"
"net/http"
"net/url"
"path"
"strings"
"time"

"github.com/oapi-codegen/runtime"
"github.com/oapi-codegen/nullable"
strictecho "github.com/oapi-codegen/runtime/strictmiddleware/echo"
strictgin "github.com/oapi-codegen/runtime/strictmiddleware/gin"
strictiris "github.com/oapi-codegen/runtime/strictmiddleware/iris"
strictnethttp "github.com/oapi-codegen/runtime/strictmiddleware/nethttp"
openapi_types "github.com/oapi-codegen/runtime/types"
"github.com/getkin/kin-openapi/openapi3"
"github.com/go-chi/chi/v5"
"github.com/labstack/echo/v4"
"github.com/gin-gonic/gin"
"github.com/gofiber/fiber/v2"
"github.com/kataras/iris/v12"
"github.com/kataras/iris/v12/core/router"
"github.com/gorilla/mux"
{{- range .ExternalImports}}
{{ . }}
{{- end}}
{{- range .AdditionalImports}}
{{.Alias}} "{{.Package}}"
{{- end}}
)

0 comments on commit ef931e8

Please sign in to comment.