2019-01-15 16:20:41 +00:00
|
|
|
// This file contains changes that are only compatible with go 1.10 and onwards.
|
|
|
|
|
2024-02-01 13:08:54 +00:00
|
|
|
//go:build go1.10
|
2019-01-15 16:20:41 +00:00
|
|
|
// +build go1.10
|
|
|
|
|
2024-02-01 13:08:54 +00:00
|
|
|
/*
|
|
|
|
Copyright 2021 The Kubernetes Authors.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2019-01-15 16:20:41 +00:00
|
|
|
package yaml
|
|
|
|
|
|
|
|
import "encoding/json"
|
|
|
|
|
|
|
|
// DisallowUnknownFields configures the JSON decoder to error out if unknown
|
|
|
|
// fields come along, instead of dropping them by default.
|
|
|
|
func DisallowUnknownFields(d *json.Decoder) *json.Decoder {
|
|
|
|
d.DisallowUnknownFields()
|
|
|
|
return d
|
|
|
|
}
|