// Try to help the GC
sites[0] = nil
- sites = sites[1:len(sites)]
+ sites = sites[1:]
}
})
}
{
"Redefine JSON",
[]map[string]interface{}{
- map[string]interface{}{
+ {
"application/json": map[string]interface{}{
"suffix": "jsn"}}},
false,
{
"Add custom media type",
[]map[string]interface{}{
- map[string]interface{}{
+ {
"text/hugo": map[string]interface{}{
"suffix": "hgo"}}},
false,
{
"Add media type invalid key",
[]map[string]interface{}{
- map[string]interface{}{
+ {
"text/hugo+hgo": map[string]interface{}{}}},
true,
func(t *testing.T, name string, tt Types) {
{
"Redefine JSON",
[]map[string]interface{}{
- map[string]interface{}{
+ {
"JsON": map[string]interface{}{
"baseName": "myindex",
"isPlainText": "false"}}},
{
"Add XML format with string as mediatype",
[]map[string]interface{}{
- map[string]interface{}{
+ {
"MYXMLFORMAT": map[string]interface{}{
"baseName": "myxml",
"mediaType": "application/xml",
{
"Add format unknown mediatype",
[]map[string]interface{}{
- map[string]interface{}{
+ {
"MYINVALID": map[string]interface{}{
"baseName": "mymy",
"mediaType": "application/hugo",
{
"Add and redefine XML format",
[]map[string]interface{}{
- map[string]interface{}{
+ {
"MYOTHERXMLFORMAT": map[string]interface{}{
"baseName": "myotherxml",
"mediaType": media.XMLType,
}},
- map[string]interface{}{
+ {
"MYOTHERXMLFORMAT": map[string]interface{}{
"baseName": "myredefined",
}},
{[]int{0, 1}, []interface{}{0}, 0, false},
{[]int{0, 1}, []interface{}{9}, nil, false}, // index out of range
{[]uint{0, 1}, nil, []uint{0, 1}, false},
- {[][]int{[]int{1, 2}, []int{3, 4}}, []interface{}{0, 0}, 1, false},
+ {[][]int{{1, 2}, {3, 4}}, []interface{}{0, 0}, 1, false},
{map[int]int{1: 10, 2: 20}, []interface{}{1}, 10, false},
{map[int]int{1: 10, 2: 20}, []interface{}{0}, 0, false},
// errors