Home / File/ context_test.go — gin Source File

context_test.go — gin Source File

Architecture documentation for context_test.go, a go file in the gin codebase. 1 imports, 0 dependents.

File go GinCore Context 1 imports 180 functions 10 classes

Entity Profile

Dependency Diagram

graph LR
  ebe0ae48_a62b_a38f_5bac_5bbbd96fc508["context_test.go"]
  fefe783b_8987_7aed_66c9_b2860bfc32e7["bytes"]
  ebe0ae48_a62b_a38f_5bac_5bbbd96fc508 --> fefe783b_8987_7aed_66c9_b2860bfc32e7
  style ebe0ae48_a62b_a38f_5bac_5bbbd96fc508 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.

package gin

import (
	"bytes"
	"context"
	"errors"
	"fmt"
	"html/template"
	"io"
	"io/fs"
	"mime/multipart"
	"net"
	"net/http"
	"net/http/httptest"
	"net/url"
	"os"
	"path/filepath"
	"reflect"
	"strconv"
	"strings"
	"sync"
	"testing"
	"time"

	"github.com/gin-contrib/sse"
	"github.com/gin-gonic/gin/binding"
	"github.com/gin-gonic/gin/codec/json"
	testdata "github.com/gin-gonic/gin/testdata/protoexample"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	"go.mongodb.org/mongo-driver/bson"
	"google.golang.org/protobuf/proto"
)

var _ context.Context = (*Context)(nil)

var errTestRender = errors.New("TestRender")

// Unit tests TODO
// func (c *Context) File(filepath string) {
// func (c *Context) Negotiate(code int, config Negotiate) {
// BAD case: func (c *Context) Render(code int, render render.Render, obj ...any) {
// test that information is not leaked when reusing Contexts (using the Pool)

func createMultipartRequest() *http.Request {
	boundary := "--testboundary"
	body := new(bytes.Buffer)
	mw := multipart.NewWriter(body)
	defer mw.Close()

	must(mw.SetBoundary(boundary))
	must(mw.WriteField("foo", "bar"))
	must(mw.WriteField("bar", "10"))
	must(mw.WriteField("bar", "foo2"))
	must(mw.WriteField("array", "first"))
	must(mw.WriteField("array", "second"))
// ... (3695 more lines)

Domain

Subdomains

Functions

Dependencies

  • bytes

Frequently Asked Questions

What does context_test.go do?
context_test.go is a source file in the gin codebase, written in go. It belongs to the GinCore domain, Context subdomain.
What functions are defined in context_test.go?
context_test.go defines 180 function(s): BenchmarkGetMapFromFormData, CreateTestResponseRecorder, TestContextAbortWithError, TestContextAbortWithStatus, TestContextAbortWithStatusJSON, TestContextAbortWithStatusPureJSON, TestContextAddParam, TestContextAutoBindJSON, TestContextAutoShouldBindJSON, TestContextBadAutoBind, and 170 more.
What does context_test.go depend on?
context_test.go imports 1 module(s): bytes.
Where is context_test.go in the architecture?
context_test.go is located at context_test.go (domain: GinCore, subdomain: Context).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free