-
Christoph Glaubitz authored
Using Tenant as an example: The API types like Tenant, now go to `tenancy_tenants_types.go`. This file ends with two `go:generate` lines. One creates `tenancy_tenants.go` with the service and the functions like Get, List, Create... The second one creates basic tests in `tenant_tenants_basic_test.go`. As a result, `tenancy_tenants.go` and `tenancy_tenants_basic_test.go` should not be edited by hand. They will be overriden with the next `go generate`. Everything belonging to the type should go into `tenancy_tenants_types.go` (For example MarshalJSON.) All further tests, no matter if it targets the type (Tenant) or service (TenantsService), should go to `tenancy_tenants_test.go`. In this commit, both (`tenancy_tenant-groups_types.go` and `tenancy_tenants_type.go`) use `go:generate` to create functions and basic tests. But this is not a must, if it makes sense to implement endpoints by hand, this is totally fine.
Christoph Glaubitz authoredUsing Tenant as an example: The API types like Tenant, now go to `tenancy_tenants_types.go`. This file ends with two `go:generate` lines. One creates `tenancy_tenants.go` with the service and the functions like Get, List, Create... The second one creates basic tests in `tenant_tenants_basic_test.go`. As a result, `tenancy_tenants.go` and `tenancy_tenants_basic_test.go` should not be edited by hand. They will be overriden with the next `go generate`. Everything belonging to the type should go into `tenancy_tenants_types.go` (For example MarshalJSON.) All further tests, no matter if it targets the type (Tenant) or service (TenantsService), should go to `tenancy_tenants_test.go`. In this commit, both (`tenancy_tenant-groups_types.go` and `tenancy_tenants_type.go`) use `go:generate` to create functions and basic tests. But this is not a must, if it makes sense to implement endpoints by hand, this is totally fine.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.