ufukty / gonfique

To get all config accesses under type checking
Apache License 2.0
14 stars 1 forks source link

Enum field containing types are not considered as candidate in type substitution #4

Open ufukty opened 9 months ago

ufukty commented 9 months ago
...
Create: { Method: "GET", Path: "/post" }
Update: { Method: "PUT", Path: "/post/{id}" }
Delete: { Method: "DELETE", Path: "/post/{id}" }
type Method int

const (
  GET = Method(iota)
  POST
  PATCH
  DELETE
  PUT
)

type Endpoint struct {
  Method Method `yaml:"Method"`
  Path   string `yaml:"Path"`
}

Considerations:

ufukty commented 4 months ago

The definitive solution to this problem might be allowing user to specify desired targets to disable automatic type resolution on, and manually assign given [existing] type.