Skip to content

Commit ade5b83

Browse files
committed
yaml: wrap yaml.Marshal calls
In service of centralizing the one package that decides which yaml library to use
1 parent 729eb2f commit ade5b83

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

pkg/output/output.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import (
2424
"strings"
2525

2626
"github.com/olekukonko/tablewriter"
27-
"gopkg.in/yaml.v3"
2827

2928
"k8s.io/enhancements/api"
29+
"k8s.io/enhancements/pkg/yaml"
3030
)
3131

3232
const (

pkg/repo/write.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ import (
2424
"path/filepath"
2525

2626
"github.com/sirupsen/logrus"
27-
"gopkg.in/yaml.v3"
2827
"k8s.io/enhancements/api"
28+
29+
"k8s.io/enhancements/pkg/yaml"
2930
)
3031

3132
func (r *Repo) WriteKEP(kep *api.Proposal) error {

pkg/yaml/yaml.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ func UnmarshalStrict(body []byte, v interface{}) error {
3434

3535
// Marshal returns a byte array containing a YAML representation of the
3636
// given interface, and a non-nil error if there was an error
37-
func Marhsal(v interface{}) ([]byte, error) {
37+
func Marshal(v interface{}) ([]byte, error) {
3838
return yaml.Marshal(v)
3939
}

0 commit comments

Comments
 (0)