Home / Function/ getMapFromFormData() — gin Function Reference

getMapFromFormData() — gin Function Reference

Architecture documentation for the getMapFromFormData() function in context.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  39008852_98f9_31e6_26b9_309011482990["getMapFromFormData()"]
  c22deef8_5218_863f_341c_441bf58f550e["context.go"]
  39008852_98f9_31e6_26b9_309011482990 -->|defined in| c22deef8_5218_863f_341c_441bf58f550e
  style 39008852_98f9_31e6_26b9_309011482990 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

context.go lines 674–695

func getMapFromFormData(m map[string][]string, key string) (map[string]string, bool) {
	d := make(map[string]string)
	found := false
	keyLen := len(key)

	for k, v := range m {
		if len(k) < keyLen+3 { // key + "[" + at least one char + "]"
			continue
		}

		if k[:keyLen] != key || k[keyLen] != '[' {
			continue
		}

		if j := strings.IndexByte(k[keyLen+1:], ']'); j > 0 {
			found = true
			d[k[keyLen+1:keyLen+1+j]] = v[0]
		}
	}

	return d, found
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does getMapFromFormData() do?
getMapFromFormData() is a function in the gin codebase, defined in context.go.
Where is getMapFromFormData() defined?
getMapFromFormData() is defined in context.go at line 674.

Analyze Your Own Codebase

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

Try Supermodel Free