Skip to content

Commit e7d22a4

Browse files
author
Marek Dalewski
committed
Cleanup repo
1 parent ba49a0c commit e7d22a4

7 files changed

Lines changed: 0 additions & 3401 deletions

File tree

asflag.go.old

Lines changed: 0 additions & 189 deletions
This file was deleted.

example_test.go

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -53,40 +53,6 @@ func ExampleRecursive_withGoFlag() {
5353
// }
5454
}
5555

56-
// func ExampleAsGoFlag_fooBarBaz() {
57-
// type Input struct {
58-
// Foo string
59-
// Bar string
60-
// Baz string
61-
// }
62-
63-
// fs := flag.NewFlagSet("", flag.ExitOnError)
64-
// ops := &jsonflag.Operations{}
65-
// for _, f := range jsonflag.Recursive(&Input{}) {
66-
// fs.Var(jsonflag.AsGoFlag(ops, f))
67-
// }
68-
// if err := fs.Parse([]string{"--Foo=foo value", "--Baz=baz value"}); err != nil {
69-
// panic(err)
70-
// }
71-
72-
// i := &Input{}
73-
// if err := ops.Apply(i); err != nil {
74-
// panic(err)
75-
// }
76-
// b, err := json.MarshalIndent(i, "", " ")
77-
// if err != nil {
78-
// panic(err)
79-
// }
80-
// fmt.Println(string(b))
81-
82-
// // Output:
83-
// // {
84-
// // "Foo": "foo value",
85-
// // "Bar": "",
86-
// // "Baz": "baz value"
87-
// // }
88-
// }
89-
9056
func ExampleRecursive_withPFlag() {
9157
type Input struct {
9258
Foo string `json:"Foo"`
@@ -125,37 +91,3 @@ func ExampleRecursive_withPFlag() {
12591
// "Baz": "another baz value"
12692
// }
12793
}
128-
129-
// func ExampleAsPFlag_fooBarBaz() {
130-
// type Input struct {
131-
// Foo string
132-
// Bar string
133-
// Baz string
134-
// }
135-
136-
// fs := pflag.NewFlagSet("", pflag.ExitOnError)
137-
// ops := &jsonflag.Operations{}
138-
// for _, f := range jsonflag.Recursive(&Input{}) {
139-
// fs.AddFlag(jsonflag.AsPFlag(ops, f))
140-
// }
141-
// if err := fs.Parse([]string{"--Foo=foo value", "--Baz=baz value", "--Baz=another baz value"}); err != nil {
142-
// panic(err)
143-
// }
144-
145-
// i := &Input{}
146-
// if err := ops.Apply(i); err != nil {
147-
// panic(err)
148-
// }
149-
// b, err := json.MarshalIndent(i, "", " ")
150-
// if err != nil {
151-
// panic(err)
152-
// }
153-
// fmt.Println(string(b))
154-
155-
// // Output:
156-
// // {
157-
// // "Foo": "foo value",
158-
// // "Bar": "",
159-
// // "Baz": "another baz value"
160-
// // }
161-
// }

0 commit comments

Comments
 (0)