(ctx context.Context, t *testctx.T)
| 1184 | } |
| 1185 | |
| 1186 | func (CLISuite) TestCLIFunctions(ctx context.Context, t *testctx.T) { |
| 1187 | c := connect(ctx, t) |
| 1188 | |
| 1189 | ctr := c.Container().From(golangImage). |
| 1190 | WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). |
| 1191 | WithWorkdir("/work"). |
| 1192 | With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")). |
| 1193 | WithNewFile("main.go", `package main |
| 1194 | |
| 1195 | import ( |
| 1196 | "context" |
| 1197 | |
| 1198 | "dagger/test/internal/dagger" |
| 1199 | ) |
| 1200 | |
| 1201 | type Test struct{} |
| 1202 | |
| 1203 | // doc for FnA |
| 1204 | func (m *Test) FnA() *dagger.Container { |
| 1205 | return nil |
| 1206 | } |
| 1207 | |
| 1208 | // doc for FnB |
| 1209 | func (m *Test) FnB() Duck { |
| 1210 | return nil |
| 1211 | } |
| 1212 | |
| 1213 | type Duck interface { |
| 1214 | DaggerObject |
| 1215 | // quack that thang |
| 1216 | Quack(ctx context.Context) (string, error) |
| 1217 | } |
| 1218 | |
| 1219 | // doc for FnC |
| 1220 | func (m *Test) FnC() *Obj { |
| 1221 | return nil |
| 1222 | } |
| 1223 | |
| 1224 | // doc for Prim |
| 1225 | func (m *Test) Prim() string { |
| 1226 | return "yo" |
| 1227 | } |
| 1228 | |
| 1229 | type Obj struct { |
| 1230 | // doc for FieldA |
| 1231 | FieldA *dagger.Container |
| 1232 | // doc for FieldB |
| 1233 | FieldB string |
| 1234 | // doc for FieldC |
| 1235 | FieldC *Obj |
| 1236 | // doc for FieldD |
| 1237 | FieldD *OtherObj |
| 1238 | } |
| 1239 | |
| 1240 | // doc for FnD |
| 1241 | func (m *Obj) FnD() *dagger.Container { |
| 1242 | return nil |
| 1243 | } |
nothing calls this directly
no test coverage detected