Skip to content

Commit

Permalink
feat: add config_generator for cwgo/pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyenought committed Aug 10, 2024
1 parent 232b14b commit 91b28c5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
6 changes: 0 additions & 6 deletions pkg/config_generator/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@

package config_generator

const (
Yaml = "yaml"
Json = "json"
Text = "text"
)

type ConfigGenerateMeta struct {
Desc string `json:"desc,omitempty"`
Kind string `json:"kind,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions pkg/config_generator/yaml2go.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import (
)

// New creates Yaml2Go object
func New(key, desc, kind string, fileType ConfigValueType) Yaml2Go {
func New(key, desc, kind string, configValueType ConfigValueType) Yaml2Go {
return Yaml2Go{
StructsMeta: &ConfigGenerateMeta{
Key: key,
Kind: kind,
Desc: desc,
ConfigValueType: fileType,
ConfigValueType: configValueType,
structTree: make(map[string]Struct),
},
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/config_generator/yaml2go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ kitex:
`

func TestYaml2Go(t *testing.T) {
yaml2Go := New("key", "desc", "group", "YamlType")
yaml2Go := New("key", "desc", "group", ConfigValueType_YamlType)
s, err := yaml2Go.Convert("config", []byte(value))
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 91b28c5

Please sign in to comment.