Expose MarshalOrder (#470)

It is needed as argument to some already public function.

Fixes #459
Ref #469
This commit is contained in:
Thomas Pelletier
2021-02-02 12:12:10 -05:00
committed by GitHub
parent c9a09d8695
commit ef48fb2be1
2 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -57,12 +57,12 @@ var annotationDefault = annotation{
defaultValue: tagDefault,
}
type marshalOrder int
type MarshalOrder int
// Orders the Encoder can write the fields to the output stream.
const (
// Sort fields alphabetically.
OrderAlphabetical marshalOrder = iota + 1
OrderAlphabetical MarshalOrder = iota + 1
// Preserve the order the fields are encountered. For example, the order of fields in
// a struct.
OrderPreserve
@@ -256,7 +256,7 @@ type Encoder struct {
annotation
line int
col int
order marshalOrder
order MarshalOrder
promoteAnon bool
indentation string
}
@@ -317,7 +317,7 @@ func (e *Encoder) ArraysWithOneElementPerLine(v bool) *Encoder {
}
// Order allows to change in which order fields will be written to the output stream.
func (e *Encoder) Order(ord marshalOrder) *Encoder {
func (e *Encoder) Order(ord MarshalOrder) *Encoder {
e.order = ord
return e
}