xml.go
This file
The walk stopped after 200 commits: lines older than cf32d2d point at it.
chore(deps): bump github.com/pelletier/go-toml/v2 from 2.2.2 to 2.2.4 (#4212)dependabot[bot]before adoptioncf32d2d
lines 1–28why, one step back1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package render67import (8 "encoding/xml"9 "net/http"10)1112// XML contains the given interface object.13type XML struct {14 Data any15}1617var xmlContentType = []string{"application/xml; charset=utf-8"}1819// Render (XML) encodes the given interface object and writes data with custom ContentType.20func (r XML) Render(w http.ResponseWriter) error {21 r.WriteContentType(w)22 return xml.NewEncoder(w).Encode(r.Data)23}2425// WriteContentType (XML) writes XML ContentType for response.26func (r XML) WriteContentType(w http.ResponseWriter) {27 writeContentType(w, xmlContentType)28}