-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprinter_test.go
More file actions
136 lines (126 loc) · 2.73 KB
/
printer_test.go
File metadata and controls
136 lines (126 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
package goty_test
import (
"time"
"golift.io/goty"
)
type TestWrapper struct {
TestEndpoint
Profile TestLevel1
Level1 TestLevel1
EP *TestEndpoint
Auth struct {
*TestEndpoint
TestLevel1
Username string `json:"username"`
Password string `json:"password"`
Decoy struct {
TestEndpoint
*TestLevel1
Apple string
Banana string
}
}
Config *goty.Config
}
type TestLevel1 struct {
Name string `json:"name"`
Date time.Time `json:"date"`
}
type TestEndpoint struct {
URL string `json:"url"`
APIKey string `json:"apiKey"`
}
func ExampleGoty_Print() {
weekdays := []goty.Enum{
{Name: "Sunday", Value: time.Sunday},
{Name: "Monday", Value: time.Monday},
{Name: "Tuesday", Value: time.Tuesday},
{Name: "Wednesday", Value: time.Wednesday},
{Name: "Thursday", Value: time.Thursday},
{Name: "Friday", Value: time.Friday},
{Name: "Saturday", Value: time.Saturday},
}
goty := goty.NewGoty(nil)
goty.Enums(weekdays)
goty.Parse(TestWrapper{})
goty.Print()
// Output:
// /* Auto-generated. DO NOT EDIT. Generator: https://golift.io/goty
// * Edit the source code and run goty again to make updates.
// */
//
// /**
// * @see golang: <time.Weekday>
// */
// export enum Weekday {
// Sunday = 0,
// Monday = 1,
// Tuesday = 2,
// Wednesday = 3,
// Thursday = 4,
// Friday = 5,
// Saturday = 6,
// };
//
// /**
// * @see golang: <golift.io/goty_test.TestWrapper>
// */
// export interface TestWrapper extends TestEndpoint {
// Profile: TestLevel1;
// Level1: TestLevel1;
// EP?: TestEndpoint;
// Auth: TestEndpoint & TestLevel1 & {
// username: string;
// password: string;
// Decoy: TestEndpoint & TestLevel1 & {
// Apple: string;
// Banana: string;
// };
// };
// Config?: Config;
// };
//
// /**
// * @see golang: <golift.io/goty_test.TestEndpoint>
// */
// export interface TestEndpoint {
// url: string;
// apiKey: string;
// };
//
// /**
// * @see golang: <golift.io/goty_test.TestLevel1>
// */
// export interface TestLevel1 {
// name: string;
// date: Date;
// };
//
// /**
// * @see golang: <golift.io/goty.Config>
// */
// export interface Config {
// overrides?: Record<null | any, Override>;
// globalOverrides: Override;
// };
//
// /**
// * @see golang: <golift.io/goty.Override>
// */
// export interface Override {
// type: string;
// name: string;
// tag: string;
// comment: string;
// optional: boolean;
// keepBadChars: boolean;
// keepUnderscores: boolean;
// usePkgName: number;
// noExport: boolean;
// nullSlicePointers: boolean;
// };
//
// // Packages parsed:
// // 1. golift.io/goty
// // 2. golift.io/goty_test
}