thinkerou
2023-01-02 12:40:48 +08:00
committed by GitHub
parent 7d8fc1563b
commit c9b27249fb
5 changed files with 4 additions and 7 deletions

View File

@ -238,7 +238,7 @@ b:
err := (YAML{data}).Render(w)
assert.NoError(t, err)
assert.Equal(t, "\"\\na : Easy!\\nb:\\n\\tc: 2\\n\\td: [3, 4]\\n\\t\"\n", w.Body.String())
assert.Equal(t, "|4-\n a : Easy!\n b:\n \tc: 2\n \td: [3, 4]\n \t\n", w.Body.String())
assert.Equal(t, "application/x-yaml; charset=utf-8", w.Header().Get("Content-Type"))
}

View File

@ -7,7 +7,7 @@ package render
import (
"net/http"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)
// YAML contains the given interface object.