diff --git a/entc/gen/internal/bindata.go b/entc/gen/internal/bindata.go index c16960adf..478c5cbc1 100644 --- a/entc/gen/internal/bindata.go +++ b/entc/gen/internal/bindata.go @@ -966,7 +966,7 @@ func templateImportTmpl() (*asset, error) { return a, nil } -var _templateMetaTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x57\xcd\x6e\xdb\x38\x10\x3e\x4b\x4f\x31\x10\x5c\xc0\x0e\x12\xb9\xed\x6d\x03\xe4\xd0\x4d\x52\x34\xd8\xa2\x28\x90\xa4\x97\xc5\xa2\xa0\xc5\xa1\x4d\x94\x22\x5d\x92\x4a\x9a\x15\xf4\xee\x0b\xfe\x49\x54\x62\xef\x6e\x7b\x31\x4c\x72\xe6\x9b\x1f\xce\x7c\x1c\xf5\xfd\xfa\xa4\xbc\x54\xfb\x27\xcd\xb7\x3b\x0b\x6f\x5f\xbf\xf9\xed\x6c\xaf\xd1\xa0\xb4\xf0\x9e\x34\xb8\x51\xea\x1b\xdc\xc8\xa6\x86\x77\x42\x80\x17\x32\xe0\xce\xf5\x03\xd2\xba\xbc\xdb\x71\x03\x46\x75\xba\x41\x68\x14\x45\xe0\x06\x04\x6f\x50\x1a\xa4\xd0\x49\x8a\x1a\xec\x0e\xe1\xdd\x9e\x34\x3b\x84\xb7\xf5\xeb\x74\x0a\x4c\x75\x92\x96\x5c\xfa\xf3\x8f\x37\x97\xd7\x9f\x6e\xaf\x81\x71\x81\x10\xf7\xb4\x52\x16\x28\xd7\xd8\x58\xa5\x9f\x40\x31\xb0\x99\x31\xab\x11\xeb\xf2\x64\x3d\x0c\x65\xd9\xf7\x40\x91\x71\x89\x50\xb5\x68\x49\x05\x61\xf3\x0c\x1e\xb9\xdd\x01\xfe\xb0\x28\x29\x2c\xa0\xfa\x4c\x9a\x6f\x64\x8b\x15\x2c\xea\xf8\x17\xce\x86\xa1\x2c\xfa\x1e\x2c\xb6\x7b\x41\x2c\x42\xb5\x43\x42\x51\x57\x50\x3b\x94\xbe\x07\xa7\x1b\x8d\x4c\x42\xbc\xdd\x2b\x6d\x2b\x58\xf8\xa3\x46\x49\x63\x61\x59\x16\xeb\x35\x7c\x24\x1b\x14\xb0\x53\x82\x1a\x1f\x85\xb1\x9a\xcb\x2d\x08\xbf\x4d\x51\x2a\xeb\x96\xee\xa4\xef\x41\xa8\x47\xd4\xb0\xa8\x3f\x91\x16\x61\x18\xc0\x3e\xed\xc7\xf0\x29\xb1\x64\x43\x0c\xd6\x65\x11\x30\x2f\xa0\xea\x7b\x58\xd4\x61\x35\x0c\x95\xb7\xe7\xb7\x6e\xae\xea\x4b\xe7\x03\x91\xd6\xc1\xbc\xb0\x3e\xb3\xcb\x29\x30\x8e\x82\x1e\x30\x74\x08\x2c\x99\xbd\xb9\xaa\x6f\xad\xd2\x64\x8b\x7f\xe0\x53\x30\xef\x52\xac\x89\xdc\x22\x2c\x18\x9c\x5f\xc0\xa2\x7e\xef\x80\x8d\x4b\x4a\xe1\x4f\x17\xc1\x92\x3b\x63\x39\x6a\x59\x24\xdf\x83\xc0\x7f\x3a\x3d\x25\x8b\x8d\xd9\x3a\x16\x45\x31\xc3\x8d\xfe\xb3\x83\xde\xa7\xcb\x75\x2a\x31\x12\x0c\x91\x5c\xd3\x2d\xe6\x81\x20\xdd\x86\x13\x3c\x1c\x87\x3f\xff\x89\x30\x70\x0c\xc3\x6b\x4a\xb7\xe0\x12\xda\xce\x12\xcb\x95\x34\x29\x8e\x84\x1b\xc3\x18\xd5\x0e\x04\xb0\xb0\xed\x5e\x38\x1f\xf7\x9a\x4b\xcb\xa0\xa2\x9c\x08\x6c\xec\xfa\x95\x59\xbb\xbe\x58\x37\xd1\x71\xe3\x3a\x20\xa6\x03\x62\x03\xfc\x18\x8b\x3b\xc0\xf8\xca\x5e\xf9\xb2\x0f\x1b\xc7\x61\x1f\x88\xe6\x64\x23\xf0\x39\x6c\xdf\x03\x67\xb0\x23\xe6\x6e\x0e\xfd\x6f\x16\xe7\x0d\xc7\x19\x28\xd7\x1f\x1f\x88\xb9\x42\x46\x3a\x61\xc3\xe2\x0b\x11\x9c\x12\xab\xb4\x71\xcd\xd3\xb5\x1f\x94\xfa\x66\xc2\xd1\x67\x25\x78\xe3\x6e\xb8\x04\x00\xf0\x57\x27\x93\x80\xbf\xd8\x51\x3c\x13\xe1\xec\x90\xf2\x4b\x80\x0b\x20\x94\x66\xeb\x37\x39\x48\xf4\xbb\x48\x80\x32\x33\xe4\xcb\xe4\x93\xb2\x08\x76\x47\xac\x2f\x85\x31\x6b\xb0\x41\xa1\x1e\x81\x68\x57\x00\xdc\x72\x22\xf8\xdf\x48\x61\xf3\x14\x58\xb0\x93\x96\xb7\x18\x10\xf6\x91\xb5\x54\xa8\xf9\x51\xdc\x97\x4c\x60\x48\x04\xb2\xdf\x0b\xde\xf8\xad\x1a\xee\x76\xa8\x91\x29\x8d\xa7\x01\x81\x5b\x30\x3b\xd5\x09\x0a\x1b\x84\xc0\x62\x38\xf6\x50\x4b\xb8\x04\x62\x80\x29\x21\xd4\xa3\x39\xf7\x2a\xfe\xa7\x08\xa2\xf0\x35\x92\xc1\xa5\x92\x8c\x6f\x47\x16\x1d\x86\x75\xf4\xb3\x8a\x3a\x79\x42\x1e\x88\x76\xe4\x78\x24\x31\x45\xf8\xff\xa7\xc3\xcd\x4e\xfe\x42\x69\x6b\xb7\x88\x8a\x09\xac\x38\x7c\x5f\x45\x51\xc4\x85\xd3\x0b\x7f\x0f\x69\x06\x5e\x30\xcf\xd8\x2a\x94\x9a\xe7\xb8\x7b\x83\xfa\xca\x3f\x26\x34\x1c\x24\x8d\x0b\x97\x58\xff\x90\xc4\x0d\x27\x1e\x44\x66\x16\x66\x84\xc8\x32\x3e\x4c\x9e\x13\x8f\x51\xa7\x82\x5e\x4a\x65\xdd\xfa\xc6\x5c\xcb\xae\x5d\x45\xd9\xe0\x2c\x8d\x32\x81\x3f\xa3\x46\x24\x00\x2f\x15\xc9\x27\xc9\xcd\xf8\x27\x6d\x3e\x10\xd1\xf9\x92\x69\x34\x86\x42\x61\x4a\x27\x36\x7a\x4e\xa7\x75\x34\x3e\xc3\x9c\x3a\xd1\xb9\x79\xc7\x5b\x0c\xff\xee\xef\x7d\x06\x58\x27\x9b\xe5\x0a\xc6\x44\x04\xd8\x3b\xf7\x96\x4d\x81\x8f\x39\x1a\x2f\x90\xd5\xf7\x7b\x4a\x2c\x5e\x8d\x86\x8e\x05\x3e\x93\xfb\xe5\xf0\x3b\x8f\xf2\x8b\xc1\x4f\x91\xff\x52\xbc\x7e\x10\x59\xb0\x3a\x23\xae\x3c\x5c\xcf\xfe\x21\xd6\x51\x62\x26\xe0\x07\x83\xf3\x0b\x18\x39\xd8\xf9\x00\xcb\x57\x66\x05\xa8\xb5\xd2\x55\xf2\x20\x77\x23\xa5\x47\xc6\x18\xb9\x01\xe2\xd2\x11\xf1\x53\x22\xaa\x59\x26\xaa\x98\x0a\xb8\xb1\x4e\xa1\x21\x42\x4c\x64\xb4\xe9\xb8\xa0\xa8\x1d\x65\x39\x4e\x01\x43\x1e\x70\x4a\x5a\xb2\xe3\x9f\x8c\x23\xd9\xc8\x17\xab\x39\xdb\xaf\x4f\xd2\x14\xd7\x74\xc6\xaa\x36\x4c\x43\xce\x4b\x94\x5d\x0b\xb1\x95\xfc\xc4\x37\xbd\xd6\xf3\xb9\x23\x4d\x73\xe9\xc2\x5c\x47\x25\xbb\xeb\x13\x50\x2d\x0f\xdc\x9b\x78\xd4\x7b\xcc\xb4\xb3\xb5\x43\x6f\xaf\x0e\x06\xe2\xdb\xeb\xd4\xcf\x2f\xc0\x6a\xde\x26\xaa\x4b\x79\xbe\x0d\xaf\xfb\x22\xe3\xc0\x6c\x18\x08\x76\x63\x3c\x66\x44\x3f\x52\x7c\x53\x7c\x2e\x99\x5e\x30\x47\x09\x83\x44\x59\xe6\xad\x33\x6f\x1a\xb7\xbf\x3e\x01\x60\x5c\x52\x8f\xef\x55\xfd\x53\x73\xa4\x21\x5c\x9c\x21\x5d\x33\xd6\xfa\x7a\x9a\x06\x20\x56\xbb\xe4\xcd\xca\x94\x33\xc0\xef\xee\x7c\xb2\xff\xc5\x37\x57\x94\x79\x51\xcb\x0e\xc1\xc7\xb8\x98\x64\x5e\xd6\x64\xee\x5b\x16\x76\xa8\xab\x22\xcc\xd6\x21\x5f\x73\x06\x80\x8b\x1c\x69\xf4\x72\xde\x78\x87\x0a\xef\xe5\x3d\xf9\x94\xf8\x91\x6b\x1c\xe5\xff\x6f\x5a\x5e\xc6\x39\x43\x4e\x63\x5b\x98\xd8\x02\xe8\xe4\xd4\xca\xf9\x12\x5a\xd9\xe4\x6a\x2b\x08\xe5\xb5\x5c\xa5\x29\xb2\x77\xca\x1a\x6d\xa7\x65\xdc\x5a\x9a\x55\x59\x14\x43\x59\x66\xcd\xf7\x9c\x42\xce\xc6\x52\x26\x7a\xeb\x4e\x35\x36\xc8\x1f\xc2\x18\xfd\x7b\x68\xe6\xf7\x71\x50\x2e\x7f\x8a\x2f\x1c\xde\x48\x16\xa1\xdc\x62\x12\x7f\x8a\x38\x7c\xec\x99\xcd\xe5\x84\x3d\xcf\x87\x67\xb9\x90\x05\xf3\xc8\x6d\xb3\x83\x5c\xd2\xdf\x45\x43\x8c\xef\x9b\x78\x67\xfc\xc0\x9d\x05\x6a\x90\xee\x14\x5e\xc3\x30\x9c\x3e\xe3\xf0\x5b\xab\xbb\xc6\xa6\x8c\xf4\x3d\xec\x89\x69\x88\x08\xf7\x37\xca\x9e\x87\xca\x8c\xb7\x21\xb9\xf0\xeb\x58\xc2\xf3\x43\xd6\xda\xfa\xda\xb9\xce\x96\x61\x70\x9a\xd8\xe2\x1c\xb8\xf4\xc9\xcd\xb2\xe7\x73\x7c\xe0\x61\x3a\x87\x57\xdf\xab\xd3\x2c\x64\x77\xf5\xc5\xe0\xef\xbf\x98\x48\xf4\xd8\xd7\xaa\x9f\xd2\x09\xa5\xdc\xbd\xfe\x44\xa4\xcf\xd6\xe7\xec\xfb\x6e\x52\xf1\xd4\xd1\x10\xe9\xa6\x44\xf5\x80\x5a\x73\x1a\xc6\x44\xa5\xfd\x27\xbd\xf2\x83\xf0\x04\x19\xbe\xfd\x53\x85\x78\x06\x8b\x1c\x5b\x8f\x8c\x9d\x7f\xa2\xcf\xbc\xc9\x67\xa8\x7f\x02\x00\x00\xff\xff\x34\x1b\x77\xea\x8f\x10\x00\x00") +var _templateMetaTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x58\x4d\x6f\xdb\x3c\x12\x3e\x4b\xbf\x62\x20\xb8\x40\x1c\x24\x72\xdf\xf7\xb6\x01\x72\xe8\x26\x29\x1a\x6c\x51\x14\x48\xd2\xcb\x62\x51\xd0\xe2\xd0\x26\x4a\x91\x2e\x49\x25\xcd\x0a\xfe\xef\x0b\x0e\x49\x7d\x24\x76\xb7\xed\x25\x10\xc9\x99\x67\x3e\x38\xf3\x70\x9c\xbe\x5f\x9d\x96\x57\x66\xf7\x6c\xe5\x66\xeb\xe1\xef\xb7\x7f\xfd\xe3\x7c\x67\xd1\xa1\xf6\xf0\x9e\x35\xb8\x36\xe6\x1b\xdc\xea\xa6\x86\x77\x4a\x01\x09\x39\x08\xe7\xf6\x11\x79\x5d\xde\x6f\xa5\x03\x67\x3a\xdb\x20\x34\x86\x23\x48\x07\x4a\x36\xa8\x1d\x72\xe8\x34\x47\x0b\x7e\x8b\xf0\x6e\xc7\x9a\x2d\xc2\xdf\xf5\xdb\x7c\x0a\xc2\x74\x9a\x97\x52\xd3\xf9\xc7\xdb\xab\x9b\x4f\x77\x37\x20\xa4\x42\x48\x7b\xd6\x18\x0f\x5c\x5a\x6c\xbc\xb1\xcf\x60\x04\xf8\x89\x31\x6f\x11\xeb\xf2\x74\xb5\xdf\x97\x65\xdf\x03\x47\x21\x35\x42\xd5\xa2\x67\x15\xc4\xcd\x73\x78\x92\x7e\x0b\xf8\xc3\xa3\xe6\xb0\x80\xea\x33\x6b\xbe\xb1\x0d\x56\xb0\xa8\xd3\x27\x9c\xef\xf7\x65\xd1\xf7\xe0\xb1\xdd\x29\xe6\x11\xaa\x2d\x32\x8e\xb6\x82\x3a\xa0\xf4\x3d\x04\xdd\x64\x64\x14\x92\xed\xce\x58\x5f\xc1\x82\x8e\x1a\xa3\x9d\x87\x93\xb2\x58\xad\xe0\x23\x5b\xa3\x82\xad\x51\xdc\x51\x14\xce\x5b\xa9\x37\xa0\x68\x9b\xa3\x36\x3e\x2c\xc3\x49\xdf\x83\x32\x4f\x68\x61\x51\x7f\x62\x2d\xc2\x7e\x0f\xfe\x79\x37\x84\xcf\x99\x67\x6b\xe6\xb0\x2e\x8b\x88\x79\x09\x55\xdf\xc3\xa2\x8e\xab\xfd\xbe\x22\x7b\xb4\x75\x7b\x5d\x5f\x05\x1f\x98\xf6\x01\xe6\x95\xf5\x99\x5d\xc9\x41\x48\x54\xfc\x80\xa1\x43\x60\xd9\xec\xed\x75\x7d\xe7\x8d\x65\x1b\xfc\x17\x3e\x47\xf3\x21\xc5\x96\xe9\x0d\xc2\x42\xc0\xc5\x25\x2c\xea\xf7\x01\xd8\x85\xa4\x14\x74\xba\x88\x96\xc2\x99\x98\xa2\x96\x45\xf6\x3d\x0a\xfc\x5f\xa7\xc7\x64\x89\x21\x5b\xc7\xa2\x28\x66\xb8\xc9\x7f\x71\xd0\xfb\x7c\xb9\x41\x25\x45\x82\x31\x92\x1b\xbe\xc1\x69\x20\xc8\x37\xf1\x04\x0f\xc7\x41\xe7\xbf\x11\x06\x0e\x61\x90\xa6\x0e\x0b\xa9\xa1\xed\x3c\xf3\xd2\x68\x97\xe3\xc8\xb8\x29\x8c\x41\xed\x40\x00\x0b\xdf\xee\x54\xf0\x71\x67\xa5\xf6\x02\x2a\x2e\x99\xc2\xc6\xaf\xde\xb8\x55\xe8\x8b\x55\x93\x1c\x77\xa1\x03\x52\x3a\x20\x35\xc0\x8f\xa1\xb8\x23\x0c\x55\xf6\x92\xca\x3e\x6e\x1c\x87\x7d\x64\x56\xb2\xb5\xc2\x97\xb0\x7d\x0f\x52\xc0\x96\xb9\xfb\x39\xf4\xcf\x2c\xce\x1b\x4e\x0a\x30\xa1\x3f\x3e\x30\x77\x8d\x82\x75\xca\xc7\xc5\x17\xa6\x24\x67\xde\x58\x17\x9a\xa7\x6b\x3f\x18\xf3\xcd\xc5\xa3\xcf\x46\xc9\x26\xdc\x70\x09\x00\x40\x57\xa7\xb3\x00\x5d\xec\x20\x3e\x11\x91\xe2\x90\xf2\x6b\x80\x4b\x60\x9c\x4f\xd6\x7f\x4d\x41\x92\xdf\x45\x06\xd4\x13\x43\x54\x26\x9f\x8c\x47\xf0\x5b\xe6\xa9\x14\x86\xac\xc1\x1a\x95\x79\x02\x66\x43\x01\x48\x2f\x99\x92\xff\x45\x0e\xeb\xe7\xc8\x82\x9d\xf6\xb2\xc5\x88\xb0\x4b\xac\x65\x62\xcd\x0f\xe2\x54\x32\x91\x21\x11\xd8\x6e\xa7\x64\x43\x5b\x35\xdc\x6f\xd1\xa2\x30\x16\xcf\x22\x82\xf4\xe0\xb6\xa6\x53\x1c\xd6\x08\x91\xc5\x70\xe8\xa1\x96\x49\x0d\xcc\x81\x30\x4a\x99\x27\x77\x41\x2a\xf4\xa7\x88\xa2\xf0\x35\x91\xc1\x95\xd1\x42\x6e\x06\x16\xdd\xef\x57\xc9\xcf\x2a\xe9\x4c\x13\xf2\xc8\x6c\x20\xc7\x23\x89\x29\xe2\xf7\xbf\x03\xee\xe4\xe4\x3f\xa8\x7d\x1d\x16\x49\x31\x83\x15\x87\xef\xab\x28\x8a\xb4\x08\x7a\xf1\xf3\x90\x66\xe4\x05\xf7\x82\xad\x62\xa9\x11\xc7\x3d\x38\xb4\xd7\xf4\x98\xf0\x78\x90\x35\x2e\x43\x62\xe9\x21\x49\x1b\x41\x3c\x8a\xcc\x2c\xcc\x08\x51\x4c\xf8\x30\x7b\xce\x08\xa3\xce\x05\x7d\xa2\x8d\x0f\xeb\x5b\x77\xa3\xbb\x76\x99\x64\xa3\xb3\x3c\xc9\x44\xfe\x4c\x1a\x89\x00\x48\x2a\x91\x4f\x96\x9b\xf1\x4f\xde\x7c\x64\xaa\xa3\x92\x69\x2c\xc6\x42\x11\xc6\x66\x36\x7a\x49\xa7\x75\x32\x3e\xc3\x1c\x3b\x31\xb8\x79\x2f\x5b\x8c\x5f\x0f\x0f\x94\x01\xd1\xe9\xe6\x64\x09\x43\x22\x22\xec\x7d\x78\xcb\xc6\xc0\x87\x1c\x0d\x17\x28\xea\x87\x1d\x67\x1e\xaf\x07\x43\xc7\x02\x9f\xc9\xfd\x71\xf8\x1d\xa1\xfc\x61\xf0\x63\xe4\x7f\x14\x2f\x0d\x22\x0b\x51\x4f\x88\x6b\x1a\x2e\xb1\x7f\x8c\x75\x90\x98\x09\xd0\x60\x70\x71\x09\x03\x07\x07\x1f\xe0\xe4\x8d\x5b\x02\x5a\x6b\x6c\x95\x3d\x98\xba\x91\xd3\xa3\x53\x8c\xd2\x01\x0b\xe9\x48\xf8\x39\x11\xd5\x2c\x13\x55\x4a\x05\xdc\xfa\xa0\xd0\x30\xa5\x46\x32\x5a\x77\x52\x71\xb4\x81\xb2\x02\xa7\x80\x63\x8f\x38\x26\x2d\xdb\xa1\x27\xe3\x48\x36\xa6\x8b\xe5\x9c\xed\x57\xa7\x79\x8a\x6b\x3a\xe7\x4d\x1b\xa7\xa1\xe0\x25\xea\xae\x85\xd4\x4a\x34\xf1\x8d\xaf\xf5\x7c\xee\xc8\xd3\x5c\xbe\xb0\xd0\x51\xd9\xee\xea\x14\x4c\x2b\x23\xf7\x66\x1e\x25\x8f\x85\x0d\xb6\xb6\x48\xf6\xea\x68\x20\xbd\xbd\x41\xfd\xe2\x12\xbc\x95\x6d\xa6\xba\x9c\xe7\xbb\xf8\xba\x2f\x26\x1c\x38\x19\x06\xa2\xdd\x14\x8f\x1b\xd0\x8f\x14\xdf\x18\x5f\x48\x26\x09\x4e\x51\xe2\x20\x51\x96\xd3\xd6\x99\x37\x4d\xd8\x5f\x9d\x02\x08\xa9\x39\xe1\x93\x2a\x3d\x35\x47\x1a\x22\xc4\x19\xd3\x35\x63\xad\xaf\x67\x79\x00\x12\x75\x48\xde\xac\x4c\xa5\x00\xfc\x1e\xce\x47\xfb\x5f\xa8\xb9\x92\xcc\xab\x5a\x0e\x08\x14\xe3\x62\x94\x79\x5d\x93\x53\xdf\x26\x61\xc7\xba\x2a\xe2\x6c\x1d\xf3\x35\x67\x00\xb8\x9c\x22\x0d\x5e\xce\x1b\xef\x50\xe1\xbd\xbe\x27\x4a\x09\x8d\x5c\xc3\x28\xff\xab\x69\x79\x1d\xe7\x0c\x39\x8f\x6d\x71\x62\x8b\xa0\xa3\x53\xcb\x32\x55\x9a\xc5\x06\xe5\x23\xda\x60\x63\xf8\x5e\x88\xfa\x9f\xb1\xe1\xa8\xbc\xd3\x75\xc5\xce\x9f\x29\xcd\x6d\x2e\x21\xd6\xe6\xc9\x32\x8f\xa0\x7d\xb0\x6c\xd1\x77\x56\xa7\xad\x97\xfa\xcb\xb2\x28\xf6\xd9\x99\x83\x6c\x74\x3e\xad\xef\x5f\x61\x94\x09\x7a\xe2\x94\x58\x95\x29\xd7\xbf\xc5\x2f\x14\xf3\xc4\xf0\xcf\xc3\x27\x46\x8c\x41\xbb\x27\xe9\x9b\x2d\xbc\x12\xa7\xcb\x6b\x98\xa3\x46\x4b\x97\x2c\x0f\x5c\x72\xe4\x12\x1d\x4e\xe1\x2d\xec\xf7\x67\x2f\x48\xff\xce\xdb\xae\xf1\xef\xd3\x6f\x8d\xbe\x87\x1d\x73\x0d\x53\xf1\xc2\x07\xd9\x8b\x58\xca\xe9\x06\xb4\x54\xb4\x4e\x35\x3f\x3f\x14\xad\xaf\x6f\x82\xff\xe2\x24\x4e\x5a\x23\xbd\x5c\x80\xd4\x94\xeb\x49\x1e\x29\xe5\x07\x5e\xb2\x0b\x78\xf3\xbd\x3a\x7b\x19\x77\xb8\xe5\x62\x4f\x57\x5d\x8c\xd4\x7b\xec\x37\x2e\xcd\xf6\x8c\x73\x19\x66\x06\xa6\xf2\x8f\xdd\x97\x9c\xfd\x6e\x54\x21\xc2\x69\x98\x0e\xb3\xa5\x79\x44\x6b\x25\x8f\xc3\xa5\xb1\xf4\x8f\x00\x43\xe3\xf3\x08\x19\xff\x63\x90\xab\x86\x78\x2f\x31\x73\x3d\xf0\xfc\xf4\x87\xfd\xcc\x9b\xe9\xe4\xf5\xbf\x00\x00\x00\xff\xff\xea\x92\x17\xc5\xc5\x10\x00\x00") func templateMetaTmplBytes() ([]byte, error) { return bindataRead( @@ -981,7 +981,7 @@ func templateMetaTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/meta.tmpl", size: 4239, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/meta.tmpl", size: 4293, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template/meta.tmpl b/entc/gen/template/meta.tmpl index 15b5c0a66..cb65318ee 100644 --- a/entc/gen/template/meta.tmpl +++ b/entc/gen/template/meta.tmpl @@ -106,19 +106,19 @@ const ( {{- end }} ) - func (s {{ $enum }}) String() string { - return string(s) + {{ $receiver := receiver $f.BuilderField -}} + func ({{ $receiver }} {{ $enum }}) String() string { + return string({{ $receiver }}) } {{ $name := $f.Validator -}} - {{ $arg := receiver $f.BuilderField }} - // {{ $name }} is a validator for the "{{ $arg }}" field enum values. It is called by the builders before save. - func {{ $name }}({{ $arg }} {{ $enum }}) error { - switch {{ $arg }} { + // {{ $name }} is a validator for the "{{ $receiver }}" field enum values. It is called by the builders before save. + func {{ $name }}({{ $receiver }} {{ $enum }}) error { + switch {{ $receiver }} { case {{ range $i, $e := $f.Enums }}{{ if ne $i 0 }},{{ end }}{{ $f.StructField }}{{ pascal $e }}{{ end }}: return nil default: - return fmt.Errorf("{{ $.Package }}: invalid enum value for {{ $f.Name }} field: %q", {{ $arg }}) + return fmt.Errorf("{{ $.Package }}: invalid enum value for {{ $f.Name }} field: %q", {{ $receiver }}) } } {{ end }} diff --git a/entc/integration/ent/user/user.go b/entc/integration/ent/user/user.go index 0e6970030..d65f07d17 100644 --- a/entc/integration/ent/user/user.go +++ b/entc/integration/ent/user/user.go @@ -167,8 +167,8 @@ const ( RoleAdmin Role = "admin" ) -func (s Role) String() string { - return string(s) +func (r Role) String() string { + return string(r) } // RoleValidator is a validator for the "r" field enum values. It is called by the builders before save. diff --git a/entc/integration/gremlin/ent/user/user.go b/entc/integration/gremlin/ent/user/user.go index 47a064e25..2d65b2f6d 100644 --- a/entc/integration/gremlin/ent/user/user.go +++ b/entc/integration/gremlin/ent/user/user.go @@ -100,8 +100,8 @@ const ( RoleAdmin Role = "admin" ) -func (s Role) String() string { - return string(s) +func (r Role) String() string { + return string(r) } // RoleValidator is a validator for the "r" field enum values. It is called by the builders before save. diff --git a/entc/integration/privacy/ent/galaxy/galaxy.go b/entc/integration/privacy/ent/galaxy/galaxy.go index 2fd284e84..e9eb59887 100644 --- a/entc/integration/privacy/ent/galaxy/galaxy.go +++ b/entc/integration/privacy/ent/galaxy/galaxy.go @@ -67,8 +67,8 @@ const ( TypeIrregular Type = "irregular" ) -func (s Type) String() string { - return string(s) +func (_type Type) String() string { + return string(_type) } // TypeValidator is a validator for the "_type" field enum values. It is called by the builders before save.