repo stringlengths 6 47 | file_url stringlengths 77 269 | file_path stringlengths 5 186 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-07 08:35:43 2026-01-07 08:55:24 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/image/docker/build_test.go | dive/image/docker/build_test.go | package docker
import (
"github.com/stretchr/testify/require"
"path/filepath"
"testing"
"github.com/spf13/afero"
"github.com/stretchr/testify/assert"
)
func TestIsFileFlagsAreSet(t *testing.T) {
tests := []struct {
name string
args []string
flags []string
expected bool
}{
{
name: "... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/image/docker/archive_resolver.go | dive/image/docker/archive_resolver.go | package docker
import (
"context"
"fmt"
"os"
"github.com/wagoodman/dive/dive/image"
)
type archiveResolver struct{}
func NewResolverFromArchive() *archiveResolver {
return &archiveResolver{}
}
// Name returns the name of the resolver to display to the user.
func (r *archiveResolver) Name() string {
return "d... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/image/podman/resolver_unsupported.go | dive/image/podman/resolver_unsupported.go | //go:build !linux && !darwin
// +build !linux,!darwin
package podman
import (
"context"
"fmt"
"github.com/wagoodman/dive/dive/image"
)
type resolver struct{}
func NewResolverFromEngine() *resolver {
return &resolver{}
}
// Name returns the name of the resolver to display to the user.
func (r *resolver) Name()... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/image/podman/resolver.go | dive/image/podman/resolver.go | //go:build linux || darwin
package podman
import (
"context"
"fmt"
"io"
"github.com/wagoodman/dive/dive/image"
"github.com/wagoodman/dive/dive/image/docker"
)
type resolver struct{}
func NewResolverFromEngine() *resolver {
return &resolver{}
}
// Name returns the name of the resolver to display to the user.... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/image/podman/build.go | dive/image/podman/build.go | //go:build linux || darwin
package podman
import (
"os"
)
func buildImageFromCli(buildArgs []string) (string, error) {
iidfile, err := os.CreateTemp("/tmp", "dive.*.iid")
if err != nil {
return "", err
}
defer os.Remove(iidfile.Name())
defer iidfile.Close()
allArgs := append([]string{"--iidfile", iidfile.N... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/image/podman/cli.go | dive/image/podman/cli.go | //go:build linux || darwin
package podman
import (
"fmt"
"github.com/wagoodman/dive/internal/log"
"github.com/wagoodman/dive/internal/utils"
"io"
"os"
"os/exec"
"strings"
)
// runPodmanCmd runs a given Podman command in the current tty
func runPodmanCmd(cmdStr string, args ...string) error {
if !isPodmanClie... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/filetree/node_data_test.go | dive/filetree/node_data_test.go | package filetree
import (
"testing"
)
func TestAssignDiffType(t *testing.T) {
tree := NewFileTree()
node, _, err := tree.AddPath("/usr", *BlankFileChangeInfo("/usr"))
if err != nil {
t.Errorf("Expected no error from fetching path. got: %v", err)
}
node.Data.DiffType = Modified
if tree.Root.Children["usr"].Da... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/filetree/file_info.go | dive/filetree/file_info.go | package filetree
import (
"archive/tar"
"fmt"
"io"
"os"
"github.com/cespare/xxhash/v2"
)
// FileInfo contains tar metadata for a specific FileNode
type FileInfo struct {
Path string `json:"path"`
TypeFlag byte `json:"typeFlag"`
Linkname string `json:"linkName"`
hash uint64 //`j... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/filetree/file_tree_test.go | dive/filetree/file_tree_test.go | package filetree
import (
"fmt"
"github.com/stretchr/testify/assert"
"testing"
)
func stringInSlice(a string, list []string) bool {
for _, b := range list {
if b == a {
return true
}
}
return false
}
func AssertDiffType(node *FileNode, expectedDiffType DiffType) error {
if node.Data.DiffType != expecte... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/filetree/node_data.go | dive/filetree/node_data.go | package filetree
var GlobalFileTreeCollapse bool
// NodeData is the payload for a FileNode
type NodeData struct {
ViewInfo ViewInfo
FileInfo FileInfo `json:"fileInfo"`
DiffType DiffType
}
// NewNodeData creates an empty NodeData struct for a FileNode
func NewNodeData() *NodeData {
return &NodeData{
ViewInfo: *... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/filetree/file_node.go | dive/filetree/file_node.go | package filetree
import (
"archive/tar"
"fmt"
"github.com/wagoodman/dive/internal/log"
"strings"
"github.com/dustin/go-humanize"
"github.com/fatih/color"
"github.com/phayes/permbits"
)
const (
AttributeFormat = "%s%s %11s %10s "
)
var diffTypeColor = map[DiffType]*color.Color{
Added: color.New(color.F... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/filetree/file_tree.go | dive/filetree/file_tree.go | package filetree
import (
"fmt"
"github.com/wagoodman/dive/internal/log"
"path"
"strings"
"github.com/google/uuid"
)
const (
newLine = "\n"
noBranchSpace = " "
branchSpace = "β "
middleItem = "ββ"
lastItem = "ββ"
whiteoutPrefix = ".wh."
double... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/filetree/view_info.go | dive/filetree/view_info.go | package filetree
// ViewInfo contains UI specific detail for a specific FileNode
type ViewInfo struct {
Collapsed bool
Hidden bool
}
// NewViewInfo creates a default ViewInfo
func NewViewInfo() (view *ViewInfo) {
return &ViewInfo{
Collapsed: GlobalFileTreeCollapse,
Hidden: false,
}
}
// Copy duplicates... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/filetree/diff.go | dive/filetree/diff.go | package filetree
import (
"fmt"
)
const (
Unmodified DiffType = iota
Modified
Added
Removed
)
// DiffType defines the comparison result between two FileNodes
type DiffType int
// String of a DiffType
func (diff DiffType) String() string {
switch diff {
case Unmodified:
return "Unmodified"
case Modified:
... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/filetree/order_strategy.go | dive/filetree/order_strategy.go | package filetree
import (
"sort"
)
type SortOrder int
const (
ByName = iota
BySizeDesc
NumSortOrderConventions
)
type OrderStrategy interface {
orderKeys(files map[string]*FileNode) []string
}
func GetSortOrderStrategy(sortOrder SortOrder) OrderStrategy {
switch sortOrder {
case ByName:
return orderByNam... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/filetree/efficiency_test.go | dive/filetree/efficiency_test.go | package filetree
import (
"testing"
)
func checkError(t *testing.T, err error, message string) {
if err != nil {
t.Errorf(message+": %+v", err)
}
}
func TestEfficiency(t *testing.T) {
trees := make([]*FileTree, 3)
for idx := range trees {
trees[idx] = NewFileTree()
}
_, _, err := trees[0].AddPath("/etc/n... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/filetree/comparer.go | dive/filetree/comparer.go | package filetree
import (
"fmt"
)
type TreeIndexKey struct {
bottomTreeStart, bottomTreeStop, topTreeStart, topTreeStop int
}
func NewTreeIndexKey(bottomTreeStart, bottomTreeStop, topTreeStart, topTreeStop int) TreeIndexKey {
return TreeIndexKey{
bottomTreeStart: bottomTreeStart,
bottomTreeStop: bottomTreeSt... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/filetree/path_error.go | dive/filetree/path_error.go | package filetree
import "fmt"
const (
ActionAdd FileAction = iota
ActionRemove
)
type FileAction int
func (fa FileAction) String() string {
switch fa {
case ActionAdd:
return "add"
case ActionRemove:
return "remove"
default:
return "<unknown file action>"
}
}
type PathError struct {
Path string
Ac... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/filetree/efficiency.go | dive/filetree/efficiency.go | package filetree
import (
"fmt"
"github.com/wagoodman/dive/internal/log"
"sort"
)
// EfficiencyData represents the storage and reference statistics for a given file tree path.
type EfficiencyData struct {
Path string
Nodes []*FileNode
CumulativeSize int64
minDiscoveredSize int64
}
... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/filetree/file_node_test.go | dive/filetree/file_node_test.go | package filetree
import (
"testing"
)
func TestAddChild(t *testing.T) {
var expected, actual int
tree := NewFileTree()
payload := FileInfo{
Path: "stufffffs",
}
one := tree.Root.AddChild("first node!", payload)
two := tree.Root.AddChild("nil node!", FileInfo{})
tree.Root.AddChild("third node!", FileInfo... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/internal/utils/view.go | internal/utils/view.go | package utils
import (
"errors"
"github.com/awesome-gocui/gocui"
"github.com/wagoodman/dive/internal/log"
)
// IsNewView determines if a view has already been created based on the set of errors given (a bit hokie)
func IsNewView(errs ...error) bool {
for _, err := range errs {
if err == nil {
return false
... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/internal/utils/format.go | internal/utils/format.go | package utils
import (
"strings"
)
// CleanArgs trims the whitespace from the given set of strings.
func CleanArgs(s []string) []string {
var r []string
for _, str := range s {
if str != "" {
r = append(r, strings.Trim(str, " "))
}
}
return r
}
| go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/internal/bus/bus.go | internal/bus/bus.go | package bus
import "github.com/wagoodman/go-partybus"
var publisher partybus.Publisher
func Set(p partybus.Publisher) {
publisher = p
}
func Get() partybus.Publisher {
return publisher
}
func Publish(e partybus.Event) {
if publisher != nil {
publisher.Publish(e)
}
}
| go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/internal/bus/helpers.go | internal/bus/helpers.go | package bus
import (
"github.com/wagoodman/dive/dive/image"
"github.com/wagoodman/dive/internal/bus/event"
"github.com/wagoodman/dive/internal/bus/event/payload"
"github.com/wagoodman/go-partybus"
"github.com/wagoodman/go-progress"
)
func Report(report string) {
if len(report) == 0 {
return
}
Publish(partyb... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/internal/bus/event/event.go | internal/bus/event/event.go | package event
import (
"github.com/wagoodman/go-partybus"
)
const (
typePrefix = "dive-cli"
// TaskStarted encompasses all events that are related to the analysis of a docker image (build, fetch, analyze)
TaskStarted partybus.EventType = typePrefix + "-task-started"
// ExploreAnalysis is a partybus event that ... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/internal/bus/event/payload/generic.go | internal/bus/event/payload/generic.go | package payload
import (
"context"
"github.com/wagoodman/go-progress"
)
type genericProgressKey struct{}
func SetGenericProgressToContext(ctx context.Context, mon *GenericProgress) context.Context {
return context.WithValue(ctx, genericProgressKey{}, mon)
}
func GetGenericProgressFromContext(ctx context.Context)... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/internal/bus/event/payload/explore.go | internal/bus/event/payload/explore.go | package payload
import "github.com/wagoodman/dive/dive/image"
type Explore struct {
Analysis image.Analysis
Content image.ContentReader
}
| go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/internal/bus/event/parser/parsers.go | internal/bus/event/parser/parsers.go | package parser
import (
"fmt"
"github.com/wagoodman/dive/dive/image"
"github.com/wagoodman/dive/internal/bus/event"
"github.com/wagoodman/dive/internal/bus/event/payload"
"github.com/wagoodman/go-partybus"
"github.com/wagoodman/go-progress"
)
type ErrBadPayload struct {
Type partybus.EventType
Field string
... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
wagoodman/dive | https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/internal/log/log.go | internal/log/log.go | package log
import (
"github.com/anchore/go-logger"
"github.com/anchore/go-logger/adapter/discard"
)
// log is the singleton used to facilitate logging internally within
var log = discard.New()
// Set replaces the default logger with the provided logger.
func Set(l logger.Logger) {
log = l
}
// Get returns the c... | go | MIT | d6c691947f8fda635c952a17ee3b7555379d58f0 | 2026-01-07T08:35:43.531869Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/gin_test.go | gin_test.go | // 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 (
"crypto/tls"
"fmt"
"html/template"
"io"
"net"
"net/http"
"net/http/httptest"
"reflect"
"strconv"
"strings"
"sync/atomic"... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/deprecated.go | deprecated.go | // 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 (
"log"
"github.com/gin-gonic/gin/binding"
)
// BindWith binds the passed struct pointer using the specified binding engine.
// S... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/routes_test.go | routes_test.go | // 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 (
"fmt"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stret... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/tree.go | tree.go | // Copyright 2013 Julien Schmidt. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found
// at https://github.com/julienschmidt/httprouter/blob/master/LICENSE
package gin
import (
"net/url"
"strings"
"unicode"
"unicode/utf8"
"github.com/gin-gonic/gin/internal/bytesc... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/gin_integration_test.go | gin_integration_test.go | // Copyright 2017 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 (
"bufio"
"crypto/tls"
"fmt"
"html/template"
"io"
"net"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"runtime"
"st... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/deprecated_test.go | deprecated_test.go | // 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"
"net/http"
"net/http/httptest"
"testing"
"github.com/gin-gonic/gin/binding"
"github.com/stretchr/testify/assert"
)
... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/routergroup_test.go | routergroup_test.go | // 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 (
"net/http"
"testing"
"github.com/stretchr/testify/assert"
)
var MaxHandlers = 32
func init() {
SetMode(TestMode)
}
func Tes... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/errors_test.go | errors_test.go | // 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 (
"errors"
"fmt"
"testing"
"github.com/gin-gonic/gin/codec/json"
"github.com/stretchr/testify/assert"
"github.com/stretchr/tes... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/middleware_test.go | middleware_test.go | // 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 (
"errors"
"net/http"
"strings"
"testing"
"github.com/gin-contrib/sse"
"github.com/stretchr/testify/assert"
)
func TestMiddle... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/test_helpers.go | test_helpers.go | // Copyright 2017 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 (
"fmt"
"net/http"
"time"
)
// CreateTestContext returns a fresh Engine and a Context associated with it.
// This is useful for t... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/path.go | path.go | // Copyright 2013 Julien Schmidt. All rights reserved.
// Based on the path package, Copyright 2009 The Go Authors.
// Use of this source code is governed by a BSD-style license that can be found
// at https://github.com/julienschmidt/httprouter/blob/master/LICENSE.
package gin
const stackBufSize = 128
// cleanPath ... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/githubapi_test.go | githubapi_test.go | // 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 (
"fmt"
"math/rand"
"net/http"
"net/http/httptest"
"os"
"strconv"
"strings"
"testing"
"github.com/stretchr/testify/assert"
... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/recovery.go | recovery.go | // 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 (
"bufio"
"bytes"
"cmp"
"errors"
"fmt"
"io"
"log"
"net"
"net/http"
"net/http/httputil"
"os"
"runtime"
"strings"
"time"
... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/errors.go | errors.go | // 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 (
"fmt"
"reflect"
"strings"
"github.com/gin-gonic/gin/codec/json"
)
// ErrorType is an unsigned 64-bit error code as defined in... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/context_test.go | context_test.go | // 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"
"ne... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | true |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/recovery_test.go | recovery_test.go | // 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 (
"net"
"net/http"
"os"
"strings"
"syscall"
"testing"
"github.com/stretchr/testify/assert"
)
func TestPanicClean(t *testing.... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/utils.go | utils.go | // 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 (
"encoding/xml"
"math"
"net/http"
"os"
"path"
"reflect"
"runtime"
"strings"
"unicode"
)
// BindKey indicates a default bin... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/routergroup.go | routergroup.go | // 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 (
"net/http"
"path"
"regexp"
"strings"
)
var (
// regEnLetter matches english letters for http method name
regEnLetter = regex... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/mode.go | mode.go | // 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 (
"flag"
"io"
"os"
"sync/atomic"
"github.com/gin-gonic/gin/binding"
)
// EnvGinMode indicates environment name for gin mode.
c... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/context_file_test.go | context_file_test.go | package gin
import (
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
)
// TestContextFileSimple tests the Context.File() method with a simple case
func TestContextFileSimple(t *testing.T) {
// Test serving an existing file
testFile := "testdata/test_file.txt"
w := httptest.NewRec... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/path_test.go | path_test.go | // Copyright 2013 Julien Schmidt. All rights reserved.
// Based on the path package, Copyright 2009 The Go Authors.
// Use of this source code is governed by a BSD-style license that can be found
// at https://github.com/julienschmidt/httprouter/blob/master/LICENSE
package gin
import (
"runtime"
"strings"
"testing... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/context_appengine.go | context_appengine.go | // Copyright 2017 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.
//go:build appengine
package gin
func init() {
defaultPlatform = PlatformGoogleAppEngine
}
| go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/debug_test.go | debug_test.go | // 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 (
"errors"
"fmt"
"html/template"
"io"
"log"
"net/http"
"os"
"strings"
"sync"
"testing"
"github.com/stretchr/testify/asser... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/logger_test.go | logger_test.go | // 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 (
"errors"
"fmt"
"net/http"
"strings"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func init() {
SetMode(TestMod... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/utils_test.go | utils_test.go | // 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"
"encoding/xml"
"fmt"
"math"
"net/http"
"testing"
"github.com/stretchr/testify/assert"
)
func init() {
SetMode(Tes... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/debug.go | debug.go | // 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 (
"fmt"
"html/template"
"runtime"
"strconv"
"strings"
"sync/atomic"
)
const ginSupportMinGoVer = 24
var runtimeVersion = runt... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/fs_test.go | fs_test.go | package gin
import (
"errors"
"net/http"
"os"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
type mockFileSystem struct {
open func(name string) (http.File, error)
}
func (m *mockFileSystem) Open(name string) (http.File, error) {
return m.open(name)
}
func TestOnlyFi... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/benchmarks_test.go | benchmarks_test.go | // Copyright 2017 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 (
"html/template"
"net/http"
"os"
"testing"
)
func BenchmarkOneRoute(B *testing.B) {
router := New()
router.GET("/ping", func(... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/gin.go | gin.go | // 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 (
"fmt"
"html/template"
"net"
"net/http"
"os"
"path"
"strings"
"sync"
"github.com/gin-gonic/gin/internal/bytesconv"
filesy... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/auth.go | auth.go | // 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 (
"crypto/subtle"
"encoding/base64"
"net/http"
"strconv"
"github.com/gin-gonic/gin/internal/bytesconv"
)
// AuthUserKey is the... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/context.go | context.go | // 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 (
"errors"
"fmt"
"io"
"io/fs"
"log"
"maps"
"math"
"mime/multipart"
"net"
"net/http"
"net/url"
"os"
"path/filepath"
"str... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | true |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/version.go | version.go | // Copyright 2018 Gin Core Team. 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
// Version is the current gin framework's version.
const Version = "v1.11.0"
| go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/response_writer.go | response_writer.go | // 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 (
"bufio"
"errors"
"io"
"net"
"net/http"
)
const (
noWritten = -1
defaultStatus = http.StatusOK
)
var errHijackAlreadyWr... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/doc.go | doc.go | /*
Package gin implements a HTTP web framework called gin.
See https://gin-gonic.com/ for more information about gin.
Example:
package main
import "github.com/gin-gonic/gin"
func main() {
r := gin.Default()
r.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",
})
})
r.Run... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/logger.go | logger.go | // 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 (
"fmt"
"io"
"net/http"
"os"
"time"
"github.com/mattn/go-isatty"
)
type consoleColorModeValue int
const (
autoColor console... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/fs.go | fs.go | // Copyright 2017 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 (
"net/http"
"os"
)
// OnlyFilesFS implements an http.FileSystem without `Readdir` functionality.
type OnlyFilesFS struct {
FileS... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/response_writer_test.go | response_writer_test.go | // 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 (
"bufio"
"net"
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/re... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/tree_test.go | tree_test.go | // Copyright 2013 Julien Schmidt. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found
// at https://github.com/julienschmidt/httprouter/blob/master/LICENSE
package gin
import (
"fmt"
"reflect"
"regexp"
"strings"
"testing"
)
// Used as a workaround since we can't ... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | true |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/mode_test.go | mode_test.go | // 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 (
"os"
"sync/atomic"
"testing"
"github.com/gin-gonic/gin/binding"
"github.com/stretchr/testify/assert"
)
func init() {
os.Set... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/auth_test.go | auth_test.go | // 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 (
"encoding/base64"
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
)
func TestBasicAuth(t *test... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/codec/json/json.go | codec/json/json.go | // Copyright 2025 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
//go:build !jsoniter && !go_json && !(sonic && (linux || windows || darwin))
package json
import (
"encoding/json"
"io"
)
// Package indicates what library ... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/codec/json/api.go | codec/json/api.go | // Copyright 2025 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package json
import "io"
// API the json codec in use.
var API Core
// Core the api for json codec.
type Core interface {
Marshal(v any) ([]byte, error)
Unm... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/codec/json/jsoniter.go | codec/json/jsoniter.go | // Copyright 2025 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
//go:build jsoniter
package json
import (
"io"
jsoniter "github.com/json-iterator/go"
)
// Package indicates what library is being used for JSON encoding.
... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/codec/json/sonic.go | codec/json/sonic.go | // Copyright 2025 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
//go:build sonic && (linux || windows || darwin)
package json
import (
"io"
"github.com/bytedance/sonic"
)
// Package indicates what library is being used ... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/codec/json/go_json.go | codec/json/go_json.go | // Copyright 2025 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
//go:build go_json
package json
import (
"io"
"github.com/goccy/go-json"
)
// Package indicates what library is being used for JSON encoding.
const Package... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/ginS/gins.go | ginS/gins.go | // 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 ginS
import (
"html/template"
"net/http"
"sync"
"github.com/gin-gonic/gin"
)
var engine = sync.OnceValue(func() *gin.Engine {
return gin.... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/ginS/gins_test.go | ginS/gins_test.go | // Copyright 2025 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package ginS
import (
"html/template"
"net/http"
"net/http/httptest"
"testing"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
)
func in... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/internal/bytesconv/bytesconv_test.go | internal/bytesconv/bytesconv_test.go | // Copyright 2020 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package bytesconv
import (
"bytes"
cRand "crypto/rand"
"math/rand"
"strings"
"testing"
"time"
)
var (
testString = "Albert Einstein: Logic will get you ... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/internal/bytesconv/bytesconv.go | internal/bytesconv/bytesconv.go | // Copyright 2023 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package bytesconv
import (
"unsafe"
)
// StringToBytes converts string to byte slice without a memory allocation.
// For more details, see https://github.com/... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/internal/fs/fs_test.go | internal/fs/fs_test.go | package fs
import (
"errors"
"net/http"
"os"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
type mockFileSystem struct {
open func(name string) (http.File, error)
}
func (m *mockFileSystem) Open(name string) (http.File, error) {
return m.open(name)
}
func TestFileSys... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/internal/fs/fs.go | internal/fs/fs.go | package fs
import (
"io/fs"
"net/http"
)
// FileSystem implements an [fs.FS].
type FileSystem struct {
http.FileSystem
}
// Open passes `Open` to the upstream implementation and return an [fs.File].
func (o FileSystem) Open(name string) (fs.File, error) {
f, err := o.FileSystem.Open(name)
if err != nil {
retu... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/render/json.go | render/json.go | // 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 render
import (
"bytes"
"fmt"
"html/template"
"net/http"
"unicode"
"github.com/gin-gonic/gin/codec/json"
"github.com/gin-gonic/gin/inter... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/render/text.go | render/text.go | // 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 render
import (
"fmt"
"net/http"
"github.com/gin-gonic/gin/internal/bytesconv"
)
// String contains the given interface object slice and it... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/render/data.go | render/data.go | // 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 render
import "net/http"
// Data contains ContentType and bytes data.
type Data struct {
ContentType string
Data []byte
}
// Render (... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/render/render_test.go | render/render_test.go | // 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 render
import (
"encoding/xml"
"errors"
"html/template"
"net"
"net/http"
"net/http/httptest"
"strconv"
"strings"
"testing"
"github.co... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/render/xml.go | render/xml.go | // 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 render
import (
"encoding/xml"
"net/http"
)
// XML contains the given interface object.
type XML struct {
Data any
}
var xmlContentType = [... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/render/msgpack.go | render/msgpack.go | // Copyright 2017 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.
//go:build !nomsgpack
package render
import (
"net/http"
"github.com/ugorji/go/codec"
)
// Check interface implemented here to support go build tag... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/render/render.go | render/render.go | // 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 render
import "net/http"
// Render interface is to be implemented by JSON, XML, HTML, YAML and so on.
type Render interface {
// Render writes... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/render/reader.go | render/reader.go | // Copyright 2018 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package render
import (
"io"
"net/http"
"strconv"
)
// Reader contains the IO reader and its length, and custom ContentType and other headers.
type Reader s... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/render/yaml.go | render/yaml.go | // 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 render
import (
"net/http"
"github.com/goccy/go-yaml"
)
// YAML contains the given interface object.
type YAML struct {
Data any
}
var yam... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/render/reader_test.go | render/reader_test.go | // Copyright 2019 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package render
import (
"net/http/httptest"
"strings"
"testing"
"github.com/stretchr/testify/require"
)
func TestReaderRenderNoHeaders(t *testing.T) {
co... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/render/protobuf.go | render/protobuf.go | // Copyright 2018 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package render
import (
"net/http"
"google.golang.org/protobuf/proto"
)
// ProtoBuf contains the given interface object.
type ProtoBuf struct {
Data any
}
... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/render/html.go | render/html.go | // 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 render
import (
"html/template"
"net/http"
"github.com/gin-gonic/gin/internal/fs"
)
// Delims represents a set of Left and Right delimiters... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/render/redirect.go | render/redirect.go | // 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 render
import (
"fmt"
"net/http"
)
// Redirect contains the http request reference and redirects status code and location.
type Redirect stru... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/render/toml.go | render/toml.go | // Copyright 2022 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package render
import (
"net/http"
"github.com/pelletier/go-toml/v2"
)
// TOML contains the given interface object.
type TOML struct {
Data any
}
var toml... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/render/render_msgpack_test.go | render/render_msgpack_test.go | // 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.
//go:build !nomsgpack
package render
import (
"bytes"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/tes... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/testdata/protoexample/test.pb.go | testdata/protoexample/test.pb.go | // Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.0
// protoc v3.15.8
// source: test.proto
package protoexample
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/binding/json.go | binding/json.go | // 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 binding
import (
"bytes"
"errors"
"io"
"net/http"
"github.com/gin-gonic/gin/codec/json"
)
// EnableDecoderUseNumber is used to call the U... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/binding/form.go | binding/form.go | // 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 binding
import (
"errors"
"net/http"
)
const defaultMemory = 32 << 20
type (
formBinding struct{}
formPostBinding struct{}
... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/binding/xml_test.go | binding/xml_test.go | // Copyright 2019 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package binding
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestXMLBindingBindBody(t *testing.T) {... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
gin-gonic/gin | https://github.com/gin-gonic/gin/blob/9914178584e42458ff7d23891463a880f58c9d86/binding/xml.go | binding/xml.go | // 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 binding
import (
"bytes"
"encoding/xml"
"io"
"net/http"
)
type xmlBinding struct{}
func (xmlBinding) Name() string {
return "xml"
}
func... | go | MIT | 9914178584e42458ff7d23891463a880f58c9d86 | 2026-01-07T08:35:43.439653Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.