@@ -27,13 +27,13 @@ import (
2727
2828func TestDocFile (t * testing.T ) {
2929 g := generator {
30- apiName : sample .ServiceTitle ,
31- serviceConfig : sample . ServiceConfig () ,
32- imports : map [pbinfo. ImportSpec ] bool {},
33- opts : & options {
34- pkgPath : sample .GoPackagePath ,
35- pkgName : sample . GoPackageName ,
36- transports : [] transport { grpc , rest } ,
30+ apiName : sample .ServiceTitle ,
31+ imports : map [pbinfo. ImportSpec ] bool {} ,
32+ cfg : & generatorConfig {
33+ pkgPath : sample . GoPackagePath ,
34+ pkgName : sample .GoPackageName ,
35+ transports : [] transport { grpc , rest } ,
36+ APIServiceConfig : sample . ServiceConfig () ,
3737 },
3838 }
3939
@@ -67,7 +67,7 @@ func TestDocFile(t *testing.T) {
6767 },
6868 } {
6969 t .Run (tst .want , func (t * testing.T ) {
70- g .opts .relLvl = tst .relLvl
70+ g .cfg .relLvl = tst .relLvl
7171 g .genDocFile (sample .Year , []* descriptorpb.ServiceDescriptorProto {serv })
7272 txtdiff .Diff (t , g .pt .String (), tst .want )
7373 g .reset ()
@@ -77,13 +77,13 @@ func TestDocFile(t *testing.T) {
7777
7878func TestDocFile_APIVersionSection (t * testing.T ) {
7979 g := generator {
80- apiName : sample .ServiceTitle ,
81- serviceConfig : sample . ServiceConfig () ,
82- imports : map [pbinfo. ImportSpec ] bool {},
83- opts : & options {
84- pkgPath : sample .GoPackagePath ,
85- pkgName : sample . GoPackageName ,
86- transports : [] transport { grpc , rest } ,
80+ apiName : sample .ServiceTitle ,
81+ imports : map [pbinfo. ImportSpec ] bool {} ,
82+ cfg : & generatorConfig {
83+ pkgPath : sample . GoPackagePath ,
84+ pkgName : sample .GoPackageName ,
85+ transports : [] transport { grpc , rest } ,
86+ APIServiceConfig : sample . ServiceConfig () ,
8787 },
8888 }
8989
@@ -110,13 +110,13 @@ func TestDocFile_APIVersionSection(t *testing.T) {
110110
111111func TestDocFileEmptyService (t * testing.T ) {
112112 g := generator {
113- apiName : sample .ServiceTitle ,
114- imports : map [pbinfo.ImportSpec ]bool {},
115- serviceConfig : sample . ServiceConfig (),
116- opts : & options {
117- pkgPath : sample .GoPackagePath ,
118- pkgName : sample . GoPackageName ,
119- transports : [] transport { grpc , rest } ,
113+ apiName : sample .ServiceTitle ,
114+ imports : map [pbinfo.ImportSpec ]bool {},
115+ cfg : & generatorConfig {
116+ pkgPath : sample . GoPackagePath ,
117+ pkgName : sample .GoPackageName ,
118+ transports : [] transport { grpc , rest } ,
119+ APIServiceConfig : sample . ServiceConfig () ,
120120 },
121121 }
122122 inputType := sample .InputType (sample .CreateRequest )
@@ -154,7 +154,7 @@ func TestDocFileEmptyService(t *testing.T) {
154154 },
155155 } {
156156 t .Run (tst .want , func (t * testing.T ) {
157- g .opts .relLvl = tst .relLvl
157+ g .cfg .relLvl = tst .relLvl
158158 g .genDocFile (sample .Year , []* descriptorpb.ServiceDescriptorProto {serv })
159159 txtdiff .Diff (t , g .pt .String (), tst .want )
160160 g .reset ()
@@ -164,9 +164,9 @@ func TestDocFileEmptyService(t *testing.T) {
164164
165165func TestApiVersionSection (t * testing.T ) {
166166 g := generator {
167- serviceConfig : sample . ServiceConfig (),
168- opts : & options {
169- pkgName : sample .GoPackageName ,
167+ cfg : & generatorConfig {
168+ pkgName : sample . GoPackageName ,
169+ APIServiceConfig : sample .ServiceConfig () ,
170170 },
171171 }
172172
0 commit comments