Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix typos in comments and tests #972

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/testsuite/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func rmTag(typedJson interface{}) (interface{}, error) {
}
return m, nil

// Array: remove tags from all itenm.
// Array: remove tags from all items.
case []interface{}:
a := make([]interface{}, len(v))
for i := range v {
Expand Down
14 changes: 7 additions & 7 deletions marshaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ randomize = true
require.Equal(t, expected, buf.String())
}

func TestMarhsalIssue888(t *testing.T) {
func TestMarshalIssue888(t *testing.T) {
type Thing struct {
FieldA string `comment:"my field A"`
FieldB string `comment:"my field B"`
Expand Down Expand Up @@ -1629,15 +1629,15 @@ func ExampleMarshal_commented() {
}

type Costs struct {
Cost *int `toml:"cost" comment:"default cost (for wildcarded equalence or matched with regex, or if no value cost set)"`
ValuesCost map[string]int `toml:"values-cost" comment:"cost with some value (for equalence without wildcards) (additional tuning, usually not needed)"`
Cost *int `toml:"cost" comment:"default cost (for wildcarded equivalence or matched with regex, or if no value cost set)"`
ValuesCost map[string]int `toml:"values-cost" comment:"cost with some value (for equivalence without wildcards) (additional tuning, usually not needed)"`
}

type ClickHouse struct {
URL string `toml:"url" comment:"default url, see https://clickhouse.tech/docs/en/interfaces/http. Can be overwritten with query-params"`

RenderMaxQueries int `toml:"render-max-queries" comment:"Max queries to render queiries"`
RenderConcurrentQueries int `toml:"render-concurrent-queries" comment:"Concurrent queries to render queiries"`
RenderMaxQueries int `toml:"render-max-queries" comment:"Max queries to render queries"`
RenderConcurrentQueries int `toml:"render-concurrent-queries" comment:"Concurrent queries to render queries"`
TaggedCosts map[string]*Costs `toml:"tagged-costs,commented"`
TreeTable string `toml:"tree-table,commented"`
ReverseTreeTable string `toml:"reverse-tree-table,commented"`
Expand Down Expand Up @@ -1711,9 +1711,9 @@ func ExampleMarshal_commented() {
// [clickhouse]
// # default url, see https://clickhouse.tech/docs/en/interfaces/http. Can be overwritten with query-params
// url = 'http://localhost:8123?cancel_http_readonly_queries_on_client_close=1'
// # Max queries to render queiries
// # Max queries to render queries
// render-max-queries = 0
// # Concurrent queries to render queiries
// # Concurrent queries to render queries
// render-concurrent-queries = 0
// # tree-table = ''
// # reverse-tree-table = ''
Expand Down
2 changes: 1 addition & 1 deletion toml_testgen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1804,7 +1804,7 @@ func TestTOMLTest_Valid_Array_Empty(t *testing.T) {
testgenValid(t, input, jsonRef)
}

func TestTOMLTest_Valid_Array_Hetergeneous(t *testing.T) {
func TestTOMLTest_Valid_Array_Heterogeneous(t *testing.T) {
input := "mixed = [[1, 2], [\"a\", \"b\"], [1.1, 2.1]]\n"
jsonRef := "{\n \"mixed\": [\n [\n {\n \"type\": \"integer\",\n \"value\": \"1\"\n },\n {\n \"type\": \"integer\",\n \"value\": \"2\"\n }\n ],\n [\n {\n \"type\": \"string\",\n \"value\": \"a\"\n },\n {\n \"type\": \"string\",\n \"value\": \"b\"\n }\n ],\n [\n {\n \"type\": \"float\",\n \"value\": \"1.1\"\n },\n {\n \"type\": \"float\",\n \"value\": \"2.1\"\n }\n ]\n ]\n}\n"
testgenValid(t, input, jsonRef)
Expand Down
2 changes: 1 addition & 1 deletion unmarshaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (d *Decoder) DisallowUnknownFields() *Decoder {
//
// With this feature enabled, types implementing the unstable/Unmarshaler
// interface can be decoded from any structure of the document. It allows types
// that don't have a straightfoward TOML representation to provide their own
// that don't have a straightforward TOML representation to provide their own
// decoding logic.
//
// Currently, types can only decode from a single value. Tables and array tables
Expand Down