Home / Function/ JSON() — gin Function Reference

JSON() — gin Function Reference

Architecture documentation for the JSON() function in errors.go from the gin codebase.

Function go CoreEngine Middleware calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  e8e7e5b4_b685_77d5_de1e_1e65b316cfbf["JSON()"]
  abaf72d8_65e3_1c79_e598_ace5a95239e5["JSON()"]
  abaf72d8_65e3_1c79_e598_ace5a95239e5 -->|calls| e8e7e5b4_b685_77d5_de1e_1e65b316cfbf
  abaf72d8_65e3_1c79_e598_ace5a95239e5["JSON()"]
  e8e7e5b4_b685_77d5_de1e_1e65b316cfbf -->|calls| abaf72d8_65e3_1c79_e598_ace5a95239e5
  c6f9abaf_00c7_d9e6_593d_b2dc45ea9b1d["Last()"]
  e8e7e5b4_b685_77d5_de1e_1e65b316cfbf -->|calls| c6f9abaf_00c7_d9e6_593d_b2dc45ea9b1d
  style e8e7e5b4_b685_77d5_de1e_1e65b316cfbf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

errors.go lines 143–156

func (a errorMsgs) JSON() any {
	switch length := len(a); length {
	case 0:
		return nil
	case 1:
		return a.Last().JSON()
	default:
		jsonData := make([]any, length)
		for i, err := range a {
			jsonData[i] = err.JSON()
		}
		return jsonData
	}
}

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does JSON() do?
JSON() is a function in the gin codebase.
What does JSON() call?
JSON() calls 2 function(s): JSON, Last.
What calls JSON()?
JSON() is called by 1 function(s): JSON.

Analyze Your Own Codebase

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

Try Supermodel Free