diff --git a/entc/gen/internal/bindata.go b/entc/gen/internal/bindata.go index 8085273ba..3105c9945 100644 --- a/entc/gen/internal/bindata.go +++ b/entc/gen/internal/bindata.go @@ -821,7 +821,7 @@ func templateDialectSqlUpdateTmpl() (*asset, error) { return a, nil } -var _templateEntTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x58\x5f\x6f\xe3\xb8\x11\x7f\xb6\x3e\xc5\x9c\xe0\xbd\xb3\x0d\x87\xda\xde\x5b\xb7\x4d\x81\x5c\x92\x05\x0c\x2c\xd2\x3f\xc9\xa2\x0f\x8b\xc5\x2e\x2d\x8d\x6c\x36\x32\xe9\x25\x29\x27\x86\xe0\xef\x5e\x0c\x29\xca\x94\xad\xe4\xd2\xeb\x93\x65\x72\xfe\xfe\x86\x33\x9c\x61\xd3\x64\xb3\xe4\x5a\x6d\xf7\x5a\xac\xd6\x16\x7e\x7d\xff\xa7\x3f\x5f\x6c\x35\x1a\x94\x16\x3e\xf2\x1c\x97\x4a\x3d\xc2\x42\xe6\x0c\xae\xaa\x0a\x1c\x91\x01\xda\xd7\x3b\x2c\x58\xf2\xb0\x16\x06\x8c\xaa\x75\x8e\x90\xab\x02\x41\x18\xa8\x44\x8e\xd2\x60\x01\xb5\x2c\x50\x83\x5d\x23\x5c\x6d\x79\xbe\x46\xf8\x95\xbd\x0f\xbb\x50\xaa\x5a\x16\x89\x90\x6e\xff\xd3\xe2\xfa\xf6\xee\xfe\x16\x4a\x51\x21\xb4\x6b\x5a\x29\x0b\x85\xd0\x98\x5b\xa5\xf7\xa0\x4a\xb0\x91\x32\xab\x11\x59\x32\xcb\x0e\x87\x24\x69\x1a\x28\xb0\x14\x12\x21\xdd\xa8\x02\xab\x14\xda\xd5\xf1\xf6\x71\x05\x1f\x2e\x61\xc9\x0d\xc2\x98\x5d\x2b\x59\x8a\x15\xfb\x07\xcf\x1f\xf9\x0a\x89\xa8\x69\xc0\xe2\x66\x5b\x71\x8b\x90\xae\x91\x17\xa8\x53\x18\x07\xf6\xe3\x96\xd8\x6c\x95\xb6\x61\x2b\xcb\x80\x84\xb3\x3b\xbe\x21\x29\xe4\x33\x19\xec\x74\x03\x4a\x2b\xec\x1e\x4a\xe5\x3d\xef\x11\x9a\x7c\x8d\x1b\xce\x12\xbb\xdf\x9e\xee\x58\x5d\xe7\x16\x9a\x64\x94\x3b\x23\xa1\xa7\xde\x49\xce\xd4\x46\x58\xcb\x57\xa6\x35\x63\x94\x65\xb0\xb8\xf1\xb8\x20\xa9\x65\xc9\x68\x71\xe3\xc5\x2e\x6e\xd8\x03\xe9\x38\x1c\xe0\xfb\x7f\x8c\x92\x1f\x52\x51\xcc\x89\x1f\x37\x5b\xbb\x4f\xbf\x27\xa3\xa6\xb9\x00\xcd\xe5\x0a\x61\xfc\x6d\x0e\xe3\x92\x60\x1a\xb3\x8f\x02\xab\xc2\x38\xe9\xa3\xd6\xcb\x92\xdd\x3b\xdb\xdc\x16\x09\x5c\x2b\x22\x21\x9d\x3b\x5e\xd5\x18\x0c\x48\x3d\x71\xeb\x50\x0a\x25\xd1\xb3\x04\x00\x60\x34\x28\xa7\x69\x40\x94\x8e\x45\x54\x15\x5f\x56\xc4\x36\x6b\x1a\x40\x49\xdb\x9e\x25\x38\xe1\x69\xa5\xb2\x4e\x0e\x4a\x23\xac\xd8\xd1\xce\xf7\x58\xf4\x03\x5f\xb5\x4b\x58\x19\xf4\x42\x5e\x07\xb1\x53\xe7\x01\x89\xbf\x9f\x84\x5d\xc3\x98\xdd\x16\x2b\x3c\x02\xe2\xff\x1d\x11\xd0\x58\x71\x2b\x94\x34\x19\xba\x1d\x8a\xba\xb2\x6b\xd4\x20\x55\x81\x26\x1c\xe5\x95\xe6\xdb\x35\xf3\x22\x1e\x02\x70\x06\xb8\x46\x58\xa2\x90\x2b\xd8\xaa\x6d\x4d\x56\x16\xb0\xdc\x9f\x1d\x9b\x7f\xd6\xa8\xf7\xf0\xb4\x46\x09\xc8\x57\xa8\x2f\x2a\xc5\x0b\xe2\xa2\x6c\x40\x0a\xfb\xc8\xdb\x15\x33\xf9\x95\x36\xf8\xce\xb8\x10\x75\x72\xf2\x22\x78\x99\xcd\xe0\xaa\x28\x04\xf9\xc0\x2b\x1f\x33\x03\x56\x01\x2f\x3a\x53\x8c\x55\x9a\xd2\xa5\xd0\x62\x87\x9a\x81\xcb\x39\xc7\x3c\xb6\x9b\x6d\x45\x07\x67\xab\x85\xb4\x25\xa4\x85\xe0\x15\xe6\x36\x7b\x67\x32\x8f\xb6\x17\x98\xc2\x98\xdd\xb7\x52\x02\xaf\x28\x61\xcd\xcd\x43\x88\x8e\x17\xe5\x60\xa6\xdd\x67\xdb\xdf\x60\x83\x21\x7a\x83\xf1\xb5\x89\x4d\x3e\x3b\x0d\x9e\x27\xe3\x9d\x94\x36\xb7\x5c\xfe\x9f\x9f\x81\x93\xc4\xff\xff\x4e\xc3\x59\x11\xf0\xe2\x8e\x95\x20\x4a\x51\x24\x94\x59\x2f\x2f\xf1\x8d\x79\xe9\x69\x43\x9d\x21\xc3\x98\x03\x79\x40\x42\x94\x65\xc8\x3e\x4b\xf1\xa3\x26\x9e\x2f\x5f\xbb\x2c\x99\x79\x36\xca\xca\x4e\x62\xd3\xb4\x30\xe1\x59\x16\xb2\x90\x8d\x03\x29\x96\x65\x40\xc7\x18\x0b\x12\x16\x83\x28\x64\xa9\xf4\xc6\xe1\xe8\x00\xd4\x48\xa5\xd7\x1d\xf7\x12\xb8\x63\x74\xc8\x3d\x71\xd3\x4a\x80\x89\x23\xfb\x51\xa3\xb1\x58\x4c\x09\xe6\x7e\x9e\x28\x0a\x00\xe5\x49\xac\xf1\x4b\xd3\x40\x85\xd2\x19\xf9\x75\xa9\x54\x15\x82\xde\x42\x2e\xe6\x3d\xd8\x5f\x40\xfd\x56\x93\x6a\x5b\x6b\x69\x22\xb4\x4f\x70\x6d\xe3\xa1\x81\x4b\x40\xad\x95\x26\x57\x5c\xd1\x2e\x56\xe8\x44\x93\x33\x84\x7b\xeb\xd0\xa9\x07\x6d\xa9\x8c\x82\x32\x27\x71\x2d\xf5\xb2\xb6\x9d\x00\x77\xab\x76\x90\xb3\x64\x54\xd6\x32\x87\xc9\xc0\x41\x9b\xbe\xe4\xcf\x64\x0a\x93\x3f\x72\x12\xe6\xde\xb7\x29\x1d\xdd\x91\x28\x01\x59\x04\x37\xa1\x3d\x16\x04\xb5\xdb\x0e\x25\x20\x96\x4e\xcb\x9e\x6f\x10\xc4\xcb\x4b\x90\xa2\xf2\xdc\x5d\x21\x25\x00\x4f\x4e\x78\x74\x2e\x4e\x61\x9c\x77\xbc\x67\x90\x31\xbf\xe5\x43\x49\x8a\xe6\xf0\xf3\x9d\xb2\x1f\x69\xef\x96\xdc\x6a\x2a\xbe\xc4\xea\x03\x44\x7e\x1f\xfb\x08\xf6\x89\x36\xbd\x07\x87\xe0\x5e\x38\xe9\x9d\xd4\x61\xc7\xe6\xa4\x2d\xf1\x7c\xa7\xea\x3f\x39\x3f\xbc\x7e\x72\xf5\x83\xbf\x65\x3b\x67\xd3\x43\x32\x3a\x24\x91\xb2\xe8\xd3\xf5\x3f\xae\x78\x0e\xd6\xe7\x02\xa9\x5d\xcb\x94\xc4\x93\xea\xdc\x34\x67\xd5\xb7\x6b\x88\xc6\x1a\x73\xa4\x5b\xc0\x77\x0b\xff\x0a\xff\xda\xed\xa8\x9f\x40\x4f\x71\xbc\x3d\xdd\x3d\x4d\x67\x31\x5c\x17\x90\xba\x7b\x2d\x3d\x47\xa4\x4b\x36\x47\x7f\x38\xc0\x8f\x1a\xb5\x40\xf3\x42\x39\x8b\x0b\x5d\xd8\xe8\x0e\x7e\xcf\xe8\xc3\x01\x66\x31\xd5\x34\xd6\x32\x99\xc2\xe9\xa1\x0e\x57\x6f\x73\x0c\xcd\xe4\xe7\x58\xc0\x75\x25\x50\xda\x06\x4e\xb4\x30\xdf\xc3\x1d\xa6\x2c\x96\x7f\x42\x34\xf5\xa1\xeb\xc2\x95\x65\xf0\x79\x5b\x10\xe8\xa1\x9e\x70\x58\xd6\xa2\xa2\x16\x9a\xea\x60\x4d\x9b\x54\xcd\x5c\x17\xdc\x77\x36\xcb\xe0\x4e\x59\x04\xbb\xe6\x76\x0e\x7b\x55\x83\x44\x2c\xe8\x2a\xcc\x79\x55\xf5\x89\x3f\xcb\x27\xcd\xb7\x93\x29\x2c\xb1\x54\x1a\x1d\x45\x27\x76\x83\x76\xad\x8a\xb9\xaf\x4f\x27\x6a\x92\xb6\x4e\x79\xf3\xb0\x80\x52\xab\x0d\x70\xb0\x9a\x4b\xc3\x73\x2a\xd8\x73\xe0\xb2\x70\xc1\x88\x16\x1d\x53\xae\x36\xd4\x78\x61\x41\x75\x4b\xab\xaa\xa2\xba\xc5\xf3\x47\x96\xbc\x29\x4e\x1e\x99\x10\xa2\xb0\xee\x57\xff\x2e\x91\x22\xf4\xc7\x02\xd4\x89\x38\x0f\x4f\x1b\x13\x07\x17\xd4\xee\xc7\x84\x56\x9b\x3a\x7c\x02\xfb\xf7\x00\x01\x5e\x5a\xd4\x20\x3c\x61\x5e\x29\x83\xc5\x9c\xc4\x1a\xe5\xf9\x29\x3c\x12\x9f\x6d\x77\xc6\x9f\x44\x55\xc1\x12\x01\x9f\x31\xaf\x09\x2f\xbb\xd6\xaa\x5e\xad\x9d\x66\xdf\x82\xc1\xd3\x5a\xe4\x6b\xc8\x35\x72\x4f\xd0\x83\xfb\xad\x88\x86\x63\xd0\x5b\x27\x20\xed\xf3\x1c\xd4\x23\xe5\xe9\x30\x6a\xac\x6d\x04\x27\x33\xfb\x7c\xe3\x3e\xa7\x09\xd5\xed\x9f\xd4\xa3\xcb\x94\x2d\x97\x22\x9f\xa4\x61\xfc\x3a\x1c\x3e\x9c\x4d\x4b\x54\x76\x7b\x38\xf1\x30\x37\xa5\x2e\x2d\x46\xaf\x6a\x86\x4b\xb0\xcf\xac\xd0\xbb\x2e\xe8\x27\xe4\x6d\xe8\xee\xad\x76\x6d\xc3\x66\x5b\xe1\x06\xa5\xf5\xd1\x2b\x37\x96\xf9\x1d\xd4\x6f\xc4\xca\x93\x4f\xa6\xd4\x9b\x91\xc4\x26\x19\xed\xb8\xee\xb2\xd3\xaf\x1a\xf6\x9b\xff\x9f\x8c\xda\x0d\xf6\x6f\x2d\x2c\xb6\xcc\x69\x2c\x72\x42\x6e\x0e\x51\x39\xe3\x7c\xb5\x9e\xa4\xa2\xb8\x7c\xb7\x4b\xe7\x67\x61\x58\xdc\x4c\xa7\xbd\xee\x50\x0c\x0f\x70\xe1\x8e\xed\x4f\x4c\x74\x21\x0d\x1a\x38\x87\xde\x04\x77\xf9\x57\x13\xb8\xfe\x46\xe6\xfa\x3b\xcd\xcf\x55\xe1\x8a\x1b\x9b\x32\x6e\xff\xdf\x19\xf6\x8e\x9a\xfd\xce\xd8\xb3\xa1\x2f\xbe\xfa\x7b\x83\x5f\xb8\xfc\x77\xe1\xdc\x99\x12\x0e\x87\xbf\xc0\x0e\x7e\xea\xdd\xfb\x6f\xb2\xdc\x99\xdb\xd3\xb4\x30\x0f\x62\xd3\xe9\x19\x16\xb3\x63\x1f\x5d\xe3\x39\xb1\x62\x83\xec\xea\xee\x7e\x71\x3d\x8d\x04\x39\xd7\x83\xb4\xf6\x68\xbd\x2a\x6f\xb6\x3b\xe5\x7e\x95\xbc\x17\x7a\x17\xf7\xd9\xae\xa7\xbf\x6b\x27\xa2\x16\x23\x92\xfa\xbf\x20\xf3\x22\x30\x43\x42\xba\x68\xbc\x88\xcf\xef\xc1\xf3\xaa\xd4\x13\x11\xaf\xf1\x9c\x43\x74\x94\x12\x89\x91\xf1\x49\xeb\xfe\x9d\x0e\x8f\xe1\xbb\xa7\xe8\xb7\xbd\xc5\xc9\x2f\xd3\x5f\xa6\x5d\x69\x09\xdb\xa1\x06\x84\x29\x81\x5c\x65\x8b\x9b\x9e\xb3\x59\x06\xa2\xe8\x8d\x03\xd4\xe7\x68\x6c\xdf\xd3\xfc\x4c\xd3\x76\x2b\x8b\x9b\xf0\x42\xf2\xa6\x12\x24\x8a\xc9\xd4\x49\x6b\x92\x91\x28\xe6\xf0\x8d\xf2\xc4\x58\x9d\x2b\xb9\x63\x57\x56\x89\x53\x01\x54\x25\x3a\x27\x44\x91\x9c\xf7\x86\xa6\x12\xb9\x6b\xd3\xb6\x55\xad\x79\xd5\xbf\xe8\x8f\x04\xbe\x62\x73\xd8\x72\x6d\x5c\xb2\xfa\x65\x55\x9e\xf4\x20\xdd\x38\xdb\xb1\x7d\xf9\xda\x73\xc2\x69\x75\xa3\x22\x3e\x5b\x32\x64\x0c\xe9\x3d\xd1\xa6\x47\x1e\x5f\xf9\x5f\x79\x56\x68\xdb\xd6\x0d\x97\xfb\xf3\x57\x85\xe1\x67\x83\xa8\xc7\x1a\x86\x3a\x36\x7a\x0a\xfe\xaa\x99\xe4\xe5\xaa\xfd\x74\x03\x0d\x75\x60\xdf\x04\x19\xe5\x6b\xee\x99\x8c\x76\xa6\x8e\xd6\xbe\x7c\x13\x5f\xdb\x8b\x0b\x2e\x21\x2f\x57\x74\xb3\xf5\xcc\x69\x9a\x6c\x06\x57\xc7\x47\x09\xf7\x5e\x40\x6d\x12\x9d\x27\xff\x0e\x70\x61\xf9\xca\xb4\x0f\x18\xa7\xcf\x9c\xd1\x5b\x96\x7b\xc9\x6a\x5f\x2b\x1e\xf8\xca\x4f\xb8\x7e\xf8\x8e\xee\x08\x1b\xc6\xd9\x76\xbc\xa3\x65\x78\xdf\x42\x70\x7c\x76\xb3\x74\x67\xa7\x17\x69\xb7\xf8\x3d\xde\x7e\xc9\x78\xd7\xce\xe4\x5c\x52\xf3\xa2\x76\xa8\xb5\x68\x47\x30\xa5\xdd\x2b\xb0\x7f\x96\xe1\x43\xef\x35\xae\xa9\xe2\xf9\xda\x0d\xf6\x6c\xd8\xd7\x81\x97\x1a\x32\x07\x65\x71\x38\x24\xff\x0d\x00\x00\xff\xff\xde\x34\x01\x7b\xc5\x16\x00\x00") +var _templateEntTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x58\xdf\x6f\xe3\xb8\xf1\x7f\xb6\xfe\x8a\x39\xc1\x7b\x67\x1b\x0e\xb5\xdf\x7b\xfb\x6e\x9b\x02\xb9\x24\x0b\x18\x58\xe4\xda\x26\x8b\x3e\x2c\x16\xbb\xb4\x34\xb2\xd9\xc8\xa4\x97\xa4\x9c\x18\x82\xff\xf7\x62\x48\x51\xa6\x6c\x25\x97\x5e\x9f\x2c\x93\xf3\xf3\x33\x9c\xe1\x0c\x9b\x26\x9b\x25\xd7\x6a\xbb\xd7\x62\xb5\xb6\xf0\xeb\xfb\xff\xfb\xff\x8b\xad\x46\x83\xd2\xc2\x47\x9e\xe3\x52\xa9\x47\x58\xc8\x9c\xc1\x55\x55\x81\x23\x32\x40\xfb\x7a\x87\x05\x4b\x1e\xd6\xc2\x80\x51\xb5\xce\x11\x72\x55\x20\x08\x03\x95\xc8\x51\x1a\x2c\xa0\x96\x05\x6a\xb0\x6b\x84\xab\x2d\xcf\xd7\x08\xbf\xb2\xf7\x61\x17\x4a\x55\xcb\x22\x11\xd2\xed\x7f\x5a\x5c\xdf\xde\xdd\xdf\x42\x29\x2a\x84\x76\x4d\x2b\x65\xa1\x10\x1a\x73\xab\xf4\x1e\x54\x09\x36\x52\x66\x35\x22\x4b\x66\xd9\xe1\x90\x24\x4d\x03\x05\x96\x42\x22\xa4\x1b\x55\x60\x95\x42\xbb\x3a\xde\x3e\xae\xe0\xc3\x25\x2c\xb9\x41\x18\xb3\x6b\x25\x4b\xb1\x62\x7f\xe7\xf9\x23\x5f\x21\x11\x35\x0d\x58\xdc\x6c\x2b\x6e\x11\xd2\x35\xf2\x02\x75\x0a\xe3\xc0\x7e\xdc\x12\x9b\xad\xd2\x36\x6c\x65\x19\x90\x70\x76\xc7\x37\x24\x85\x7c\x26\x83\x9d\x6e\x40\x69\x85\xdd\x43\xa9\xbc\xe7\x3d\x42\x93\xaf\x71\xc3\x59\x62\xf7\xdb\xd3\x1d\xab\xeb\xdc\x42\x93\x8c\x72\x67\x24\xf4\xd4\x3b\xc9\x99\xda\x08\x6b\xf9\xca\xb4\x66\x8c\xb2\x0c\x16\x37\x1e\x17\x24\xb5\x2c\x19\x2d\x6e\xbc\xd8\xc5\x0d\x7b\x20\x1d\x87\x03\x7c\xff\xb7\x51\xf2\x43\x2a\x8a\x39\xf1\xe3\x66\x6b\xf7\xe9\xf7\x64\xd4\x34\x17\xa0\xb9\x5c\x21\x8c\xbf\xcd\x61\x5c\x12\x4c\x63\xf6\x51\x60\x55\x18\x27\x7d\xd4\x7a\x59\xb2\x7b\x67\x9b\xdb\x22\x81\x6b\x45\x24\xa4\x73\xc7\xab\x1a\x83\x01\xa9\x27\x6e\x1d\x4a\xa1\x24\x7a\x96\x00\x00\x8c\x06\xe5\x34\x0d\x88\xd2\xb1\x88\xaa\xe2\xcb\x8a\xd8\x66\x4d\x03\x28\x69\xdb\xb3\x04\x27\x3c\xad\x54\xd6\xc9\x41\x69\x84\x15\x3b\xda\xf9\x1e\x8b\x7e\xe0\xab\x76\x09\x2b\x83\x5e\xc8\xeb\x20\x76\xea\x3c\x20\xf1\xf7\x93\xb0\x6b\x18\xb3\xdb\x62\x85\x47\x40\xfc\xbf\x23\x02\x1a\x2b\x6e\x85\x92\x26\x43\xb7\x43\x51\x57\x76\x8d\x1a\xa4\x2a\xd0\x84\xa3\xbc\xd2\x7c\xbb\x66\x5e\xc4\x43\x00\xce\x00\xd7\x08\x4b\x14\x72\x05\x5b\xb5\xad\xc9\xca\x02\x96\xfb\xb3\x63\xf3\x8f\x1a\xf5\x1e\x9e\xd6\x28\x01\xf9\x0a\xf5\x45\xa5\x78\x41\x5c\x94\x0d\x48\x61\x1f\x79\xbb\x62\x26\xbf\xd2\x06\xdf\x19\x17\xa2\x4e\x4e\x5e\x04\x2f\xb3\x19\x5c\x15\x85\x20\x1f\x78\xe5\x63\x66\xc0\x2a\xe0\x45\x67\x8a\xb1\x4a\x53\xba\x14\x5a\xec\x50\x33\x70\x39\xe7\x98\xc7\x76\xb3\xad\xe8\xe0\x6c\xb5\x90\xb6\x84\xb4\x10\xbc\xc2\xdc\x66\xef\x4c\xe6\xd1\xf6\x02\x53\x18\xb3\xfb\x56\x4a\xe0\x15\x25\xac\xb9\x79\x08\xd1\xf1\xa2\x1c\xcc\xb4\xfb\x6c\xfb\x1b\x6c\x30\x44\x6f\x30\xbe\x36\xb1\xc9\x67\xa7\xc1\xf3\x64\xbc\x93\xd2\xe6\x96\xcb\xff\xf3\x33\x70\x92\xf8\xff\xdb\x69\x38\x2b\x02\x5e\xdc\xb1\x12\x44\x29\x8a\x84\x32\xeb\xe5\x25\xbe\x31\x2f\x3d\x6d\xa8\x33\x64\x18\x73\x20\x0f\x48\x88\xb2\x0c\xd9\x67\x29\x7e\xd4\xc4\xf3\xe5\x6b\x97\x25\x33\xcf\x46\x59\xd9\x49\x6c\x9a\x16\x26\x3c\xcb\x42\x16\xb2\x71\x20\xc5\xb2\x0c\xe8\x18\x63\x41\xc2\x62\x10\x85\x2c\x95\xde\x38\x1c\x1d\x80\x1a\xa9\xf4\xba\xe3\x5e\x02\x77\x8c\x0e\xb9\x27\x6e\x5a\x09\x30\x71\x64\x3f\x6a\x34\x16\x8b\x29\xc1\xdc\xcf\x13\x45\x01\xa0\x3c\x89\x35\x7e\x69\x1a\xa8\x50\x3a\x23\xbf\x2e\x95\xaa\x42\xd0\x5b\xc8\xc5\xbc\x07\xfb\x0b\xa8\xff\xae\x6f\x35\x29\xb7\xb5\x96\x26\xc2\xfb\x04\xd9\x36\x22\x1a\xb8\x04\xd4\x5a\x69\x72\xc6\x95\xed\x62\x85\x4e\x38\xb9\x43\xc8\xb7\x2e\x9d\xfa\xd0\x16\xcb\x28\x2c\x73\x12\xd7\x52\x2f\x6b\xdb\x09\x70\xf7\x6a\x07\x3a\x4b\x46\x65\x2d\x73\x98\x0c\x1c\xb5\xe9\xcb\x1e\x4d\xa6\x30\xf9\x33\xa7\x61\xee\xbd\x9b\xd2\xf1\x1d\x89\x12\x90\x45\x90\x13\xe2\x63\x41\x70\xbb\xed\x50\x06\x62\xe9\xb4\xec\xf9\x06\x61\xbc\xbc\x04\x29\x2a\xcf\xdd\x15\x53\x82\xf0\xe4\x94\x47\x67\xe3\x14\xc8\x79\xc7\x7b\x06\x1a\xf3\x5b\x3e\x98\xa4\x68\x0e\x3f\xdf\x29\xfb\x91\xf6\x6e\xc9\xad\xa6\xe2\x4b\xac\x3e\x40\xe4\xf7\xb1\x97\x60\x9f\x68\xd3\x7b\x70\x08\xee\x85\xd3\xde\x49\x1d\x76\x6c\x4e\xda\x12\xcf\x77\xaa\xfe\x93\xf3\xc3\xeb\x27\x57\x3f\xf8\x9b\xb6\x73\x36\x3d\x24\xa3\x43\x12\x29\x8b\x3e\x5d\x0f\xe4\x0a\xe8\x60\x8d\x2e\x90\x5a\xb6\x4c\x49\x3c\xa9\xd0\x4d\x73\x56\x81\xbb\xa6\x68\xac\x31\x47\xba\x09\x7c\xc7\xf0\xcf\xf0\xaf\xdd\x8e\x7a\x0a\xf4\x14\xc7\x1b\xd4\xdd\xd5\x74\x1a\xc3\x95\x01\xa9\xbb\xdb\xd2\x73\x44\xba\x84\x73\xf4\x87\x03\xfc\xa8\x51\x0b\x34\x2f\x94\xb4\xb8\xd8\x85\x8d\xee\xe8\xf7\x8c\x3e\x1c\x60\x16\x53\x4d\x63\x2d\x93\x29\x9c\x1e\xea\x70\xfd\x36\xc7\xd0\x4c\x7e\x8e\x05\x5c\x57\x02\xa5\x6d\xe0\x44\x0b\xf3\x7d\xdc\x61\xca\x62\xf9\x27\x44\x53\x1f\xba\x2e\x5c\x59\x06\x9f\xb7\x05\x81\x1e\x2a\x0a\x87\x65\x2d\x2a\x6a\xa3\xa9\x16\xd6\xb4\x49\x15\xcd\x75\xc2\x7d\x67\xb3\x0c\xee\x94\x45\xb0\x6b\x6e\xe7\xb0\x57\x35\x48\xc4\x82\xae\xc3\x9c\x57\x55\x9f\xf8\xb3\x7c\xd2\x7c\x3b\x99\xc2\x12\x4b\xa5\xd1\x51\x74\x62\x37\x68\xd7\xaa\x98\xfb\x0a\x75\xa2\x26\x69\x2b\x95\x37\x0f\x0b\x28\xb5\xda\x00\x07\xab\xb9\x34\x3c\xa7\xa2\x3d\x07\x2e\x0b\x17\x8c\x68\xd1\x31\xe5\x6a\x43\xcd\x17\x16\x54\xb9\xb4\xaa\x2a\xaa\x5c\x3c\x7f\x64\xc9\x9b\xe2\xe4\x91\x09\x21\x0a\xeb\x7e\xf5\x77\x89\x14\xa1\x3f\x17\xa0\x4e\xc4\x79\x78\xda\x98\x38\xb8\xa0\x76\x3f\x26\xb4\xdb\xd4\xe5\x13\xd8\x7f\x04\x08\xf0\xd2\xa2\x06\xe1\x09\xf3\x4a\x19\x2c\xe6\x24\xd6\x28\xcf\x4f\xe1\x91\xf8\x6c\xbb\x33\xfe\x24\xaa\x0a\x96\x08\xf8\x8c\x79\x4d\x78\xd9\xb5\x56\xf5\x6a\xed\x34\xfb\x36\x0c\x9e\xd6\x22\x5f\x43\xae\x91\x7b\x82\x1e\xdc\x6f\x45\x34\x1c\x83\xde\x3a\x01\x69\x9f\xe7\xa0\x1e\x29\x4f\x87\x51\x63\x6d\x33\x38\x99\xd9\xe7\x1b\xf7\x39\x4d\xa8\x6e\xff\xa4\x1e\x5d\xa6\x6c\xb9\x14\xf9\x24\x0d\x23\xd8\xe1\xf0\xe1\x6c\x62\xa2\xb2\xdb\xc3\x89\x87\xd9\x29\x75\x69\x31\x7a\x55\x33\x5c\x82\x7d\x66\x85\xde\x75\x41\x3f\x21\x6f\x43\x77\x6f\xb5\x6b\x1d\x36\xdb\x0a\x37\x28\xad\x8f\x5e\xb9\xb1\xcc\xef\xa0\x7e\x23\x56\x9e\x7c\x32\xa5\xfe\x8c\x24\x36\xc9\x68\xc7\x75\x97\x9d\x7e\xd5\xb0\xdf\xfc\xff\x64\xd4\x6e\xb0\x7f\x69\x61\xb1\x65\x4e\x63\x91\x13\x72\x73\x88\xca\x19\xe7\xab\xf5\x24\x15\xc5\xe5\xbb\x5d\x3a\x3f\x0b\xc3\xe2\x66\x3a\xed\x75\x88\x62\x78\x88\x0b\x77\x6c\x7f\x6a\xa2\x0b\x69\xd0\xc0\x39\xf4\xa6\xb8\xcb\xbf\x9a\xc0\xf5\x37\x32\xd7\xdf\x69\x7e\xb6\x0a\x57\xdc\xd8\x94\xf1\x08\xf0\xce\xb0\x77\xd4\xf0\x77\xc6\x9e\x0d\x7e\xf1\xd5\xdf\x1b\xfe\xc2\xe5\xbf\x0b\xe7\xce\x94\x70\x38\xfc\x05\x76\xf0\x53\xef\xde\x7f\x93\xe5\xce\xdc\x9e\xa6\x85\x79\x10\x9b\x4e\xcf\xb0\x98\x1d\xfb\xe8\x9a\xcf\x89\x15\x1b\x64\x57\x77\xf7\x8b\xeb\x69\x24\xc8\xb9\x1e\xa4\xb5\x47\xeb\x55\x79\xb3\xdd\x29\xf7\xab\xe4\xbd\xd0\xbb\xb8\xcf\x76\x3d\xfd\x5d\x3b\x11\xb5\x18\x91\xd4\xff\x06\x99\x17\x81\x19\x12\xd2\x45\xe3\x45\x7c\xfe\x08\x9e\x57\xa5\x9e\x88\x78\x8d\xe7\x1c\xa2\xa3\x94\x48\x8c\x8c\x4f\x5a\xf7\xef\x74\x80\x0c\xdf\x3d\x45\xbf\xed\x2d\x4e\x7e\x99\xfe\x32\xed\x4a\x4b\xd8\x0e\x35\x20\x4c\x0a\xe4\x2a\x5b\xdc\xf4\x9c\xcd\x32\x10\x45\x6f\x20\xa0\x3e\x47\x63\xfb\xa6\xe6\xe7\x9a\xb6\x5b\x59\xdc\x84\x57\x92\x37\x95\x20\x51\x4c\xa6\x4e\x5a\x93\x8c\x44\x31\x87\x6f\x94\x27\xc6\xea\x5c\xc9\x1d\xbb\xb2\x4a\x9c\x0a\xa0\x2a\xd1\x39\x21\x8a\xe4\xbc\x37\x34\x95\xc8\x5d\x9b\xb6\xad\x6a\xcd\xab\xfe\x45\x7f\x24\xf0\x15\x9b\xc3\x96\x6b\xe3\x92\xd5\x2f\xab\xf2\xa4\x07\xe9\x46\xda\x8e\xed\xcb\xd7\x9e\x13\x4e\xab\x1b\x17\xf1\xd9\x92\x21\x63\x48\xef\x89\x36\x3d\xf2\xf8\xca\xff\xca\xd3\x42\xdb\xb6\x6e\xb8\xdc\x9f\xbf\x2c\x0c\x3f\x1d\x44\x3d\xd6\x30\xd4\xb1\xd1\x53\xf0\x57\xcd\x24\x2f\x57\xed\xa7\x1b\x68\xa8\x03\xfb\x26\xc8\x28\x5f\x73\xcf\x64\xb4\x73\x75\xb4\xf6\xe5\x9b\xf8\xda\x5e\x5c\x70\x09\x79\xb9\xa2\x9b\xad\x67\x4e\xd3\x64\x33\xb8\x3a\x3e\x4c\xb8\x37\x03\x6a\x93\xe8\x3c\xf9\xb7\x80\x0b\xcb\x57\xa6\x7d\xc4\x38\x7d\xea\x8c\xde\xb3\xdc\x6b\x56\xfb\x62\xf1\xc0\x57\x7e\xca\xf5\x03\x78\x74\x47\xd8\x30\xd2\xb6\xe3\x1d\x2d\xc3\xfb\x16\x82\xe3\xd3\x9b\xa5\x3b\x3b\xbd\x48\xbb\xc5\xef\xf1\xf6\x4b\xc6\xbb\x76\x26\xe7\x92\x9a\x17\xb5\x43\xad\x45\x3b\x82\x29\xed\x5e\x82\xfd\xd3\x0c\x1f\x7a\xb3\x71\x4d\x15\xcf\xd7\x6e\xb8\x67\xc3\xbe\x0e\xbc\xd6\x90\x39\x28\x8b\xc3\x21\xf9\x4f\x00\x00\x00\xff\xff\x85\xbd\x21\x67\xc9\x16\x00\x00") func templateEntTmplBytes() ([]byte, error) { return bindataRead( @@ -836,7 +836,7 @@ func templateEntTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/ent.tmpl", size: 5829, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/ent.tmpl", size: 5833, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template/ent.tmpl b/entc/gen/template/ent.tmpl index 0180346e1..c28ec9430 100644 --- a/entc/gen/template/ent.tmpl +++ b/entc/gen/template/ent.tmpl @@ -47,9 +47,9 @@ type {{ $.Name }}Edges struct { } {{- range $i, $e := . }} - // {{ $e.StructField }}Err returns the {{ $e.StructField }} value or an error if the edge + // {{ $e.StructField }}OrErr returns the {{ $e.StructField }} value or an error if the edge // was not loaded in eager-loading{{ if $e.Unique }}, or loaded but was not found{{ end }}. - func (e {{ $.Name }}Edges) {{ $e.StructField }}Err() ({{ if not $e.Unique }}[]{{ end }}*{{ $e.Type.Name }}, error) { + func (e {{ $.Name }}Edges) {{ $e.StructField }}OrErr() ({{ if not $e.Unique }}[]{{ end }}*{{ $e.Type.Name }}, error) { if e.loadedTypes[{{ $i }}] { {{- if $e.Unique }} if e.{{ $e.StructField }} == nil { diff --git a/entc/integration/customid/ent/group.go b/entc/integration/customid/ent/group.go index a0265c504..9ce113268 100644 --- a/entc/integration/customid/ent/group.go +++ b/entc/integration/customid/ent/group.go @@ -33,9 +33,9 @@ type GroupEdges struct { loadedTypes [1]bool } -// UsersErr returns the Users value or an error if the edge +// UsersOrErr returns the Users value or an error if the edge // was not loaded in eager-loading. -func (e GroupEdges) UsersErr() ([]*User, error) { +func (e GroupEdges) UsersOrErr() ([]*User, error) { if e.loadedTypes[0] { return e.Users, nil } diff --git a/entc/integration/customid/ent/user.go b/entc/integration/customid/ent/user.go index c7c97b8e2..41141dad9 100644 --- a/entc/integration/customid/ent/user.go +++ b/entc/integration/customid/ent/user.go @@ -38,18 +38,18 @@ type UserEdges struct { loadedTypes [3]bool } -// GroupsErr returns the Groups value or an error if the edge +// GroupsOrErr returns the Groups value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) GroupsErr() ([]*Group, error) { +func (e UserEdges) GroupsOrErr() ([]*Group, error) { if e.loadedTypes[0] { return e.Groups, nil } return nil, &NotLoadedError{edge: "groups"} } -// ParentErr returns the Parent value or an error if the edge +// ParentOrErr returns the Parent value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e UserEdges) ParentErr() (*User, error) { +func (e UserEdges) ParentOrErr() (*User, error) { if e.loadedTypes[1] { if e.Parent == nil { // The edge parent was loaded in eager-loading, @@ -61,9 +61,9 @@ func (e UserEdges) ParentErr() (*User, error) { return nil, &NotLoadedError{edge: "parent"} } -// ChildrenErr returns the Children value or an error if the edge +// ChildrenOrErr returns the Children value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) ChildrenErr() ([]*User, error) { +func (e UserEdges) ChildrenOrErr() ([]*User, error) { if e.loadedTypes[2] { return e.Children, nil } diff --git a/entc/integration/ent/card.go b/entc/integration/ent/card.go index e31a836ac..5a394d4b1 100644 --- a/entc/integration/ent/card.go +++ b/entc/integration/ent/card.go @@ -50,9 +50,9 @@ type CardEdges struct { loadedTypes [2]bool } -// OwnerErr returns the Owner value or an error if the edge +// OwnerOrErr returns the Owner value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e CardEdges) OwnerErr() (*User, error) { +func (e CardEdges) OwnerOrErr() (*User, error) { if e.loadedTypes[0] { if e.Owner == nil { // The edge owner was loaded in eager-loading, @@ -64,9 +64,9 @@ func (e CardEdges) OwnerErr() (*User, error) { return nil, &NotLoadedError{edge: "owner"} } -// SpecErr returns the Spec value or an error if the edge +// SpecOrErr returns the Spec value or an error if the edge // was not loaded in eager-loading. -func (e CardEdges) SpecErr() ([]*Spec, error) { +func (e CardEdges) SpecOrErr() ([]*Spec, error) { if e.loadedTypes[1] { return e.Spec, nil } diff --git a/entc/integration/ent/file.go b/entc/integration/ent/file.go index 52dd589ab..dfa36c2f7 100644 --- a/entc/integration/ent/file.go +++ b/entc/integration/ent/file.go @@ -49,9 +49,9 @@ type FileEdges struct { loadedTypes [2]bool } -// OwnerErr returns the Owner value or an error if the edge +// OwnerOrErr returns the Owner value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e FileEdges) OwnerErr() (*User, error) { +func (e FileEdges) OwnerOrErr() (*User, error) { if e.loadedTypes[0] { if e.Owner == nil { // The edge owner was loaded in eager-loading, @@ -63,9 +63,9 @@ func (e FileEdges) OwnerErr() (*User, error) { return nil, &NotLoadedError{edge: "owner"} } -// TypeErr returns the Type value or an error if the edge +// TypeOrErr returns the Type value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e FileEdges) TypeErr() (*FileType, error) { +func (e FileEdges) TypeOrErr() (*FileType, error) { if e.loadedTypes[1] { if e.Type == nil { // The edge type was loaded in eager-loading, diff --git a/entc/integration/ent/filetype.go b/entc/integration/ent/filetype.go index f22ffc1f5..42117f831 100644 --- a/entc/integration/ent/filetype.go +++ b/entc/integration/ent/filetype.go @@ -36,9 +36,9 @@ type FileTypeEdges struct { loadedTypes [1]bool } -// FilesErr returns the Files value or an error if the edge +// FilesOrErr returns the Files value or an error if the edge // was not loaded in eager-loading. -func (e FileTypeEdges) FilesErr() ([]*File, error) { +func (e FileTypeEdges) FilesOrErr() ([]*File, error) { if e.loadedTypes[0] { return e.Files, nil } diff --git a/entc/integration/ent/group.go b/entc/integration/ent/group.go index a353e904e..7a57cb4b6 100644 --- a/entc/integration/ent/group.go +++ b/entc/integration/ent/group.go @@ -53,36 +53,36 @@ type GroupEdges struct { loadedTypes [4]bool } -// FilesErr returns the Files value or an error if the edge +// FilesOrErr returns the Files value or an error if the edge // was not loaded in eager-loading. -func (e GroupEdges) FilesErr() ([]*File, error) { +func (e GroupEdges) FilesOrErr() ([]*File, error) { if e.loadedTypes[0] { return e.Files, nil } return nil, &NotLoadedError{edge: "files"} } -// BlockedErr returns the Blocked value or an error if the edge +// BlockedOrErr returns the Blocked value or an error if the edge // was not loaded in eager-loading. -func (e GroupEdges) BlockedErr() ([]*User, error) { +func (e GroupEdges) BlockedOrErr() ([]*User, error) { if e.loadedTypes[1] { return e.Blocked, nil } return nil, &NotLoadedError{edge: "blocked"} } -// UsersErr returns the Users value or an error if the edge +// UsersOrErr returns the Users value or an error if the edge // was not loaded in eager-loading. -func (e GroupEdges) UsersErr() ([]*User, error) { +func (e GroupEdges) UsersOrErr() ([]*User, error) { if e.loadedTypes[2] { return e.Users, nil } return nil, &NotLoadedError{edge: "users"} } -// InfoErr returns the Info value or an error if the edge +// InfoOrErr returns the Info value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e GroupEdges) InfoErr() (*GroupInfo, error) { +func (e GroupEdges) InfoOrErr() (*GroupInfo, error) { if e.loadedTypes[3] { if e.Info == nil { // The edge info was loaded in eager-loading, diff --git a/entc/integration/ent/groupinfo.go b/entc/integration/ent/groupinfo.go index 3b022885d..e352ce581 100644 --- a/entc/integration/ent/groupinfo.go +++ b/entc/integration/ent/groupinfo.go @@ -38,9 +38,9 @@ type GroupInfoEdges struct { loadedTypes [1]bool } -// GroupsErr returns the Groups value or an error if the edge +// GroupsOrErr returns the Groups value or an error if the edge // was not loaded in eager-loading. -func (e GroupInfoEdges) GroupsErr() ([]*Group, error) { +func (e GroupInfoEdges) GroupsOrErr() ([]*Group, error) { if e.loadedTypes[0] { return e.Groups, nil } diff --git a/entc/integration/ent/node.go b/entc/integration/ent/node.go index 1d826504d..446bfa3af 100644 --- a/entc/integration/ent/node.go +++ b/entc/integration/ent/node.go @@ -39,9 +39,9 @@ type NodeEdges struct { loadedTypes [2]bool } -// PrevErr returns the Prev value or an error if the edge +// PrevOrErr returns the Prev value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e NodeEdges) PrevErr() (*Node, error) { +func (e NodeEdges) PrevOrErr() (*Node, error) { if e.loadedTypes[0] { if e.Prev == nil { // The edge prev was loaded in eager-loading, @@ -53,9 +53,9 @@ func (e NodeEdges) PrevErr() (*Node, error) { return nil, &NotLoadedError{edge: "prev"} } -// NextErr returns the Next value or an error if the edge +// NextOrErr returns the Next value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e NodeEdges) NextErr() (*Node, error) { +func (e NodeEdges) NextOrErr() (*Node, error) { if e.loadedTypes[1] { if e.Next == nil { // The edge next was loaded in eager-loading, diff --git a/entc/integration/ent/pet.go b/entc/integration/ent/pet.go index aeca43b45..afd56ccf3 100644 --- a/entc/integration/ent/pet.go +++ b/entc/integration/ent/pet.go @@ -41,9 +41,9 @@ type PetEdges struct { loadedTypes [2]bool } -// TeamErr returns the Team value or an error if the edge +// TeamOrErr returns the Team value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e PetEdges) TeamErr() (*User, error) { +func (e PetEdges) TeamOrErr() (*User, error) { if e.loadedTypes[0] { if e.Team == nil { // The edge team was loaded in eager-loading, @@ -55,9 +55,9 @@ func (e PetEdges) TeamErr() (*User, error) { return nil, &NotLoadedError{edge: "team"} } -// OwnerErr returns the Owner value or an error if the edge +// OwnerOrErr returns the Owner value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e PetEdges) OwnerErr() (*User, error) { +func (e PetEdges) OwnerOrErr() (*User, error) { if e.loadedTypes[1] { if e.Owner == nil { // The edge owner was loaded in eager-loading, diff --git a/entc/integration/ent/spec.go b/entc/integration/ent/spec.go index 5fdc7b431..586dd9250 100644 --- a/entc/integration/ent/spec.go +++ b/entc/integration/ent/spec.go @@ -34,9 +34,9 @@ type SpecEdges struct { loadedTypes [1]bool } -// CardErr returns the Card value or an error if the edge +// CardOrErr returns the Card value or an error if the edge // was not loaded in eager-loading. -func (e SpecEdges) CardErr() ([]*Card, error) { +func (e SpecEdges) CardOrErr() ([]*Card, error) { if e.loadedTypes[0] { return e.Card, nil } diff --git a/entc/integration/ent/user.go b/entc/integration/ent/user.go index 121547c33..6f95d5ad3 100644 --- a/entc/integration/ent/user.go +++ b/entc/integration/ent/user.go @@ -75,9 +75,9 @@ type UserEdges struct { loadedTypes [11]bool } -// CardErr returns the Card value or an error if the edge +// CardOrErr returns the Card value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e UserEdges) CardErr() (*Card, error) { +func (e UserEdges) CardOrErr() (*Card, error) { if e.loadedTypes[0] { if e.Card == nil { // The edge card was loaded in eager-loading, @@ -89,63 +89,63 @@ func (e UserEdges) CardErr() (*Card, error) { return nil, &NotLoadedError{edge: "card"} } -// PetsErr returns the Pets value or an error if the edge +// PetsOrErr returns the Pets value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) PetsErr() ([]*Pet, error) { +func (e UserEdges) PetsOrErr() ([]*Pet, error) { if e.loadedTypes[1] { return e.Pets, nil } return nil, &NotLoadedError{edge: "pets"} } -// FilesErr returns the Files value or an error if the edge +// FilesOrErr returns the Files value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) FilesErr() ([]*File, error) { +func (e UserEdges) FilesOrErr() ([]*File, error) { if e.loadedTypes[2] { return e.Files, nil } return nil, &NotLoadedError{edge: "files"} } -// GroupsErr returns the Groups value or an error if the edge +// GroupsOrErr returns the Groups value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) GroupsErr() ([]*Group, error) { +func (e UserEdges) GroupsOrErr() ([]*Group, error) { if e.loadedTypes[3] { return e.Groups, nil } return nil, &NotLoadedError{edge: "groups"} } -// FriendsErr returns the Friends value or an error if the edge +// FriendsOrErr returns the Friends value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) FriendsErr() ([]*User, error) { +func (e UserEdges) FriendsOrErr() ([]*User, error) { if e.loadedTypes[4] { return e.Friends, nil } return nil, &NotLoadedError{edge: "friends"} } -// FollowersErr returns the Followers value or an error if the edge +// FollowersOrErr returns the Followers value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) FollowersErr() ([]*User, error) { +func (e UserEdges) FollowersOrErr() ([]*User, error) { if e.loadedTypes[5] { return e.Followers, nil } return nil, &NotLoadedError{edge: "followers"} } -// FollowingErr returns the Following value or an error if the edge +// FollowingOrErr returns the Following value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) FollowingErr() ([]*User, error) { +func (e UserEdges) FollowingOrErr() ([]*User, error) { if e.loadedTypes[6] { return e.Following, nil } return nil, &NotLoadedError{edge: "following"} } -// TeamErr returns the Team value or an error if the edge +// TeamOrErr returns the Team value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e UserEdges) TeamErr() (*Pet, error) { +func (e UserEdges) TeamOrErr() (*Pet, error) { if e.loadedTypes[7] { if e.Team == nil { // The edge team was loaded in eager-loading, @@ -157,9 +157,9 @@ func (e UserEdges) TeamErr() (*Pet, error) { return nil, &NotLoadedError{edge: "team"} } -// SpouseErr returns the Spouse value or an error if the edge +// SpouseOrErr returns the Spouse value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e UserEdges) SpouseErr() (*User, error) { +func (e UserEdges) SpouseOrErr() (*User, error) { if e.loadedTypes[8] { if e.Spouse == nil { // The edge spouse was loaded in eager-loading, @@ -171,18 +171,18 @@ func (e UserEdges) SpouseErr() (*User, error) { return nil, &NotLoadedError{edge: "spouse"} } -// ChildrenErr returns the Children value or an error if the edge +// ChildrenOrErr returns the Children value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) ChildrenErr() ([]*User, error) { +func (e UserEdges) ChildrenOrErr() ([]*User, error) { if e.loadedTypes[9] { return e.Children, nil } return nil, &NotLoadedError{edge: "children"} } -// ParentErr returns the Parent value or an error if the edge +// ParentOrErr returns the Parent value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e UserEdges) ParentErr() (*User, error) { +func (e UserEdges) ParentOrErr() (*User, error) { if e.loadedTypes[10] { if e.Parent == nil { // The edge parent was loaded in eager-loading, diff --git a/entc/integration/gremlin/ent/card.go b/entc/integration/gremlin/ent/card.go index c5d7787c0..db7de7588 100644 --- a/entc/integration/gremlin/ent/card.go +++ b/entc/integration/gremlin/ent/card.go @@ -48,9 +48,9 @@ type CardEdges struct { loadedTypes [2]bool } -// OwnerErr returns the Owner value or an error if the edge +// OwnerOrErr returns the Owner value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e CardEdges) OwnerErr() (*User, error) { +func (e CardEdges) OwnerOrErr() (*User, error) { if e.loadedTypes[0] { if e.Owner == nil { // The edge owner was loaded in eager-loading, @@ -62,9 +62,9 @@ func (e CardEdges) OwnerErr() (*User, error) { return nil, &NotLoadedError{edge: "owner"} } -// SpecErr returns the Spec value or an error if the edge +// SpecOrErr returns the Spec value or an error if the edge // was not loaded in eager-loading. -func (e CardEdges) SpecErr() ([]*Spec, error) { +func (e CardEdges) SpecOrErr() ([]*Spec, error) { if e.loadedTypes[1] { return e.Spec, nil } diff --git a/entc/integration/gremlin/ent/file.go b/entc/integration/gremlin/ent/file.go index d0bc46f68..17d3f11b4 100644 --- a/entc/integration/gremlin/ent/file.go +++ b/entc/integration/gremlin/ent/file.go @@ -45,9 +45,9 @@ type FileEdges struct { loadedTypes [2]bool } -// OwnerErr returns the Owner value or an error if the edge +// OwnerOrErr returns the Owner value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e FileEdges) OwnerErr() (*User, error) { +func (e FileEdges) OwnerOrErr() (*User, error) { if e.loadedTypes[0] { if e.Owner == nil { // The edge owner was loaded in eager-loading, @@ -59,9 +59,9 @@ func (e FileEdges) OwnerErr() (*User, error) { return nil, &NotLoadedError{edge: "owner"} } -// TypeErr returns the Type value or an error if the edge +// TypeOrErr returns the Type value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e FileEdges) TypeErr() (*FileType, error) { +func (e FileEdges) TypeOrErr() (*FileType, error) { if e.loadedTypes[1] { if e.Type == nil { // The edge type was loaded in eager-loading, diff --git a/entc/integration/gremlin/ent/filetype.go b/entc/integration/gremlin/ent/filetype.go index 4590ca60c..834dde789 100644 --- a/entc/integration/gremlin/ent/filetype.go +++ b/entc/integration/gremlin/ent/filetype.go @@ -35,9 +35,9 @@ type FileTypeEdges struct { loadedTypes [1]bool } -// FilesErr returns the Files value or an error if the edge +// FilesOrErr returns the Files value or an error if the edge // was not loaded in eager-loading. -func (e FileTypeEdges) FilesErr() ([]*File, error) { +func (e FileTypeEdges) FilesOrErr() ([]*File, error) { if e.loadedTypes[0] { return e.Files, nil } diff --git a/entc/integration/gremlin/ent/group.go b/entc/integration/gremlin/ent/group.go index 8f5a1ec82..bf253ff79 100644 --- a/entc/integration/gremlin/ent/group.go +++ b/entc/integration/gremlin/ent/group.go @@ -51,36 +51,36 @@ type GroupEdges struct { loadedTypes [4]bool } -// FilesErr returns the Files value or an error if the edge +// FilesOrErr returns the Files value or an error if the edge // was not loaded in eager-loading. -func (e GroupEdges) FilesErr() ([]*File, error) { +func (e GroupEdges) FilesOrErr() ([]*File, error) { if e.loadedTypes[0] { return e.Files, nil } return nil, &NotLoadedError{edge: "files"} } -// BlockedErr returns the Blocked value or an error if the edge +// BlockedOrErr returns the Blocked value or an error if the edge // was not loaded in eager-loading. -func (e GroupEdges) BlockedErr() ([]*User, error) { +func (e GroupEdges) BlockedOrErr() ([]*User, error) { if e.loadedTypes[1] { return e.Blocked, nil } return nil, &NotLoadedError{edge: "blocked"} } -// UsersErr returns the Users value or an error if the edge +// UsersOrErr returns the Users value or an error if the edge // was not loaded in eager-loading. -func (e GroupEdges) UsersErr() ([]*User, error) { +func (e GroupEdges) UsersOrErr() ([]*User, error) { if e.loadedTypes[2] { return e.Users, nil } return nil, &NotLoadedError{edge: "users"} } -// InfoErr returns the Info value or an error if the edge +// InfoOrErr returns the Info value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e GroupEdges) InfoErr() (*GroupInfo, error) { +func (e GroupEdges) InfoOrErr() (*GroupInfo, error) { if e.loadedTypes[3] { if e.Info == nil { // The edge info was loaded in eager-loading, diff --git a/entc/integration/gremlin/ent/groupinfo.go b/entc/integration/gremlin/ent/groupinfo.go index 3376e0ddd..a464fa75d 100644 --- a/entc/integration/gremlin/ent/groupinfo.go +++ b/entc/integration/gremlin/ent/groupinfo.go @@ -37,9 +37,9 @@ type GroupInfoEdges struct { loadedTypes [1]bool } -// GroupsErr returns the Groups value or an error if the edge +// GroupsOrErr returns the Groups value or an error if the edge // was not loaded in eager-loading. -func (e GroupInfoEdges) GroupsErr() ([]*Group, error) { +func (e GroupInfoEdges) GroupsOrErr() ([]*Group, error) { if e.loadedTypes[0] { return e.Groups, nil } diff --git a/entc/integration/gremlin/ent/node.go b/entc/integration/gremlin/ent/node.go index 50e867ae1..8b3c4c58a 100644 --- a/entc/integration/gremlin/ent/node.go +++ b/entc/integration/gremlin/ent/node.go @@ -38,9 +38,9 @@ type NodeEdges struct { loadedTypes [2]bool } -// PrevErr returns the Prev value or an error if the edge +// PrevOrErr returns the Prev value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e NodeEdges) PrevErr() (*Node, error) { +func (e NodeEdges) PrevOrErr() (*Node, error) { if e.loadedTypes[0] { if e.Prev == nil { // The edge prev was loaded in eager-loading, @@ -52,9 +52,9 @@ func (e NodeEdges) PrevErr() (*Node, error) { return nil, &NotLoadedError{edge: "prev"} } -// NextErr returns the Next value or an error if the edge +// NextOrErr returns the Next value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e NodeEdges) NextErr() (*Node, error) { +func (e NodeEdges) NextOrErr() (*Node, error) { if e.loadedTypes[1] { if e.Next == nil { // The edge next was loaded in eager-loading, diff --git a/entc/integration/gremlin/ent/pet.go b/entc/integration/gremlin/ent/pet.go index fb5b5f028..61e1f0ae8 100644 --- a/entc/integration/gremlin/ent/pet.go +++ b/entc/integration/gremlin/ent/pet.go @@ -38,9 +38,9 @@ type PetEdges struct { loadedTypes [2]bool } -// TeamErr returns the Team value or an error if the edge +// TeamOrErr returns the Team value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e PetEdges) TeamErr() (*User, error) { +func (e PetEdges) TeamOrErr() (*User, error) { if e.loadedTypes[0] { if e.Team == nil { // The edge team was loaded in eager-loading, @@ -52,9 +52,9 @@ func (e PetEdges) TeamErr() (*User, error) { return nil, &NotLoadedError{edge: "team"} } -// OwnerErr returns the Owner value or an error if the edge +// OwnerOrErr returns the Owner value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e PetEdges) OwnerErr() (*User, error) { +func (e PetEdges) OwnerOrErr() (*User, error) { if e.loadedTypes[1] { if e.Owner == nil { // The edge owner was loaded in eager-loading, diff --git a/entc/integration/gremlin/ent/spec.go b/entc/integration/gremlin/ent/spec.go index d1232c58a..8370071a0 100644 --- a/entc/integration/gremlin/ent/spec.go +++ b/entc/integration/gremlin/ent/spec.go @@ -33,9 +33,9 @@ type SpecEdges struct { loadedTypes [1]bool } -// CardErr returns the Card value or an error if the edge +// CardOrErr returns the Card value or an error if the edge // was not loaded in eager-loading. -func (e SpecEdges) CardErr() ([]*Card, error) { +func (e SpecEdges) CardOrErr() ([]*Card, error) { if e.loadedTypes[0] { return e.Card, nil } diff --git a/entc/integration/gremlin/ent/user.go b/entc/integration/gremlin/ent/user.go index 8ff4bf372..2939c5a92 100644 --- a/entc/integration/gremlin/ent/user.go +++ b/entc/integration/gremlin/ent/user.go @@ -72,9 +72,9 @@ type UserEdges struct { loadedTypes [11]bool } -// CardErr returns the Card value or an error if the edge +// CardOrErr returns the Card value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e UserEdges) CardErr() (*Card, error) { +func (e UserEdges) CardOrErr() (*Card, error) { if e.loadedTypes[0] { if e.Card == nil { // The edge card was loaded in eager-loading, @@ -86,63 +86,63 @@ func (e UserEdges) CardErr() (*Card, error) { return nil, &NotLoadedError{edge: "card"} } -// PetsErr returns the Pets value or an error if the edge +// PetsOrErr returns the Pets value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) PetsErr() ([]*Pet, error) { +func (e UserEdges) PetsOrErr() ([]*Pet, error) { if e.loadedTypes[1] { return e.Pets, nil } return nil, &NotLoadedError{edge: "pets"} } -// FilesErr returns the Files value or an error if the edge +// FilesOrErr returns the Files value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) FilesErr() ([]*File, error) { +func (e UserEdges) FilesOrErr() ([]*File, error) { if e.loadedTypes[2] { return e.Files, nil } return nil, &NotLoadedError{edge: "files"} } -// GroupsErr returns the Groups value or an error if the edge +// GroupsOrErr returns the Groups value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) GroupsErr() ([]*Group, error) { +func (e UserEdges) GroupsOrErr() ([]*Group, error) { if e.loadedTypes[3] { return e.Groups, nil } return nil, &NotLoadedError{edge: "groups"} } -// FriendsErr returns the Friends value or an error if the edge +// FriendsOrErr returns the Friends value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) FriendsErr() ([]*User, error) { +func (e UserEdges) FriendsOrErr() ([]*User, error) { if e.loadedTypes[4] { return e.Friends, nil } return nil, &NotLoadedError{edge: "friends"} } -// FollowersErr returns the Followers value or an error if the edge +// FollowersOrErr returns the Followers value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) FollowersErr() ([]*User, error) { +func (e UserEdges) FollowersOrErr() ([]*User, error) { if e.loadedTypes[5] { return e.Followers, nil } return nil, &NotLoadedError{edge: "followers"} } -// FollowingErr returns the Following value or an error if the edge +// FollowingOrErr returns the Following value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) FollowingErr() ([]*User, error) { +func (e UserEdges) FollowingOrErr() ([]*User, error) { if e.loadedTypes[6] { return e.Following, nil } return nil, &NotLoadedError{edge: "following"} } -// TeamErr returns the Team value or an error if the edge +// TeamOrErr returns the Team value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e UserEdges) TeamErr() (*Pet, error) { +func (e UserEdges) TeamOrErr() (*Pet, error) { if e.loadedTypes[7] { if e.Team == nil { // The edge team was loaded in eager-loading, @@ -154,9 +154,9 @@ func (e UserEdges) TeamErr() (*Pet, error) { return nil, &NotLoadedError{edge: "team"} } -// SpouseErr returns the Spouse value or an error if the edge +// SpouseOrErr returns the Spouse value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e UserEdges) SpouseErr() (*User, error) { +func (e UserEdges) SpouseOrErr() (*User, error) { if e.loadedTypes[8] { if e.Spouse == nil { // The edge spouse was loaded in eager-loading, @@ -168,18 +168,18 @@ func (e UserEdges) SpouseErr() (*User, error) { return nil, &NotLoadedError{edge: "spouse"} } -// ChildrenErr returns the Children value or an error if the edge +// ChildrenOrErr returns the Children value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) ChildrenErr() ([]*User, error) { +func (e UserEdges) ChildrenOrErr() ([]*User, error) { if e.loadedTypes[9] { return e.Children, nil } return nil, &NotLoadedError{edge: "children"} } -// ParentErr returns the Parent value or an error if the edge +// ParentOrErr returns the Parent value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e UserEdges) ParentErr() (*User, error) { +func (e UserEdges) ParentOrErr() (*User, error) { if e.loadedTypes[10] { if e.Parent == nil { // The edge parent was loaded in eager-loading, diff --git a/entc/integration/idtype/ent/user.go b/entc/integration/idtype/ent/user.go index 41a273644..ee76e866c 100644 --- a/entc/integration/idtype/ent/user.go +++ b/entc/integration/idtype/ent/user.go @@ -40,9 +40,9 @@ type UserEdges struct { loadedTypes [3]bool } -// SpouseErr returns the Spouse value or an error if the edge +// SpouseOrErr returns the Spouse value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e UserEdges) SpouseErr() (*User, error) { +func (e UserEdges) SpouseOrErr() (*User, error) { if e.loadedTypes[0] { if e.Spouse == nil { // The edge spouse was loaded in eager-loading, @@ -54,18 +54,18 @@ func (e UserEdges) SpouseErr() (*User, error) { return nil, &NotLoadedError{edge: "spouse"} } -// FollowersErr returns the Followers value or an error if the edge +// FollowersOrErr returns the Followers value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) FollowersErr() ([]*User, error) { +func (e UserEdges) FollowersOrErr() ([]*User, error) { if e.loadedTypes[1] { return e.Followers, nil } return nil, &NotLoadedError{edge: "followers"} } -// FollowingErr returns the Following value or an error if the edge +// FollowingOrErr returns the Following value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) FollowingErr() ([]*User, error) { +func (e UserEdges) FollowingOrErr() ([]*User, error) { if e.loadedTypes[2] { return e.Following, nil } diff --git a/entc/integration/integration_test.go b/entc/integration/integration_test.go index 42276c0ca..35ca90e54 100644 --- a/entc/integration/integration_test.go +++ b/entc/integration/integration_test.go @@ -911,19 +911,19 @@ func EagerLoading(t *testing.T, client *ent.Client) { require.Nil(users[1].Edges.Card) edges := users[0].Edges - pets, err := edges.PetsErr() + pets, err := edges.PetsOrErr() require.True(ent.IsNotLoaded(err)) require.Nil(pets) - groups, err := edges.GroupsErr() + groups, err := edges.GroupsOrErr() require.True(ent.IsNotLoaded(err)) require.Nil(groups) - card, err := edges.CardErr() + card, err := edges.CardOrErr() require.Nil(err) require.NotNil(card) - spouse, err := edges.SpouseErr() + spouse, err := edges.SpouseOrErr() require.Nil(err) require.NotNil(spouse) - parent, err := edges.ParentErr() + parent, err := edges.ParentOrErr() require.True(ent.IsNotFound(err), "loaded but was not found") require.Nil(parent) }) diff --git a/entc/integration/migrate/entv1/car.go b/entc/integration/migrate/entv1/car.go index 31bd15fa1..cf537fd05 100644 --- a/entc/integration/migrate/entv1/car.go +++ b/entc/integration/migrate/entv1/car.go @@ -35,9 +35,9 @@ type CarEdges struct { loadedTypes [1]bool } -// OwnerErr returns the Owner value or an error if the edge +// OwnerOrErr returns the Owner value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e CarEdges) OwnerErr() (*User, error) { +func (e CarEdges) OwnerOrErr() (*User, error) { if e.loadedTypes[0] { if e.Owner == nil { // The edge owner was loaded in eager-loading, diff --git a/entc/integration/migrate/entv1/user.go b/entc/integration/migrate/entv1/user.go index f1fd5942d..3dd708c41 100644 --- a/entc/integration/migrate/entv1/user.go +++ b/entc/integration/migrate/entv1/user.go @@ -56,9 +56,9 @@ type UserEdges struct { loadedTypes [4]bool } -// ParentErr returns the Parent value or an error if the edge +// ParentOrErr returns the Parent value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e UserEdges) ParentErr() (*User, error) { +func (e UserEdges) ParentOrErr() (*User, error) { if e.loadedTypes[0] { if e.Parent == nil { // The edge parent was loaded in eager-loading, @@ -70,18 +70,18 @@ func (e UserEdges) ParentErr() (*User, error) { return nil, &NotLoadedError{edge: "parent"} } -// ChildrenErr returns the Children value or an error if the edge +// ChildrenOrErr returns the Children value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) ChildrenErr() ([]*User, error) { +func (e UserEdges) ChildrenOrErr() ([]*User, error) { if e.loadedTypes[1] { return e.Children, nil } return nil, &NotLoadedError{edge: "children"} } -// SpouseErr returns the Spouse value or an error if the edge +// SpouseOrErr returns the Spouse value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e UserEdges) SpouseErr() (*User, error) { +func (e UserEdges) SpouseOrErr() (*User, error) { if e.loadedTypes[2] { if e.Spouse == nil { // The edge spouse was loaded in eager-loading, @@ -93,9 +93,9 @@ func (e UserEdges) SpouseErr() (*User, error) { return nil, &NotLoadedError{edge: "spouse"} } -// CarErr returns the Car value or an error if the edge +// CarOrErr returns the Car value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e UserEdges) CarErr() (*Car, error) { +func (e UserEdges) CarOrErr() (*Car, error) { if e.loadedTypes[3] { if e.Car == nil { // The edge car was loaded in eager-loading, diff --git a/entc/integration/migrate/entv2/car.go b/entc/integration/migrate/entv2/car.go index 4e54db6f0..5ea76c7b7 100644 --- a/entc/integration/migrate/entv2/car.go +++ b/entc/integration/migrate/entv2/car.go @@ -35,9 +35,9 @@ type CarEdges struct { loadedTypes [1]bool } -// OwnerErr returns the Owner value or an error if the edge +// OwnerOrErr returns the Owner value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e CarEdges) OwnerErr() (*User, error) { +func (e CarEdges) OwnerOrErr() (*User, error) { if e.loadedTypes[0] { if e.Owner == nil { // The edge owner was loaded in eager-loading, diff --git a/entc/integration/migrate/entv2/user.go b/entc/integration/migrate/entv2/user.go index 1b61d4fe4..cf2bc8dfc 100644 --- a/entc/integration/migrate/entv2/user.go +++ b/entc/integration/migrate/entv2/user.go @@ -51,9 +51,9 @@ type UserEdges struct { loadedTypes [1]bool } -// CarErr returns the Car value or an error if the edge +// CarOrErr returns the Car value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) CarErr() ([]*Car, error) { +func (e UserEdges) CarOrErr() ([]*Car, error) { if e.loadedTypes[0] { return e.Car, nil } diff --git a/entc/integration/template/ent/pet.go b/entc/integration/template/ent/pet.go index 76372df98..df0eace1f 100644 --- a/entc/integration/template/ent/pet.go +++ b/entc/integration/template/ent/pet.go @@ -40,9 +40,9 @@ type PetEdges struct { loadedTypes [1]bool } -// OwnerErr returns the Owner value or an error if the edge +// OwnerOrErr returns the Owner value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e PetEdges) OwnerErr() (*User, error) { +func (e PetEdges) OwnerOrErr() (*User, error) { if e.loadedTypes[0] { if e.Owner == nil { // The edge owner was loaded in eager-loading, diff --git a/entc/integration/template/ent/user.go b/entc/integration/template/ent/user.go index 0d6df8310..ed459a31f 100644 --- a/entc/integration/template/ent/user.go +++ b/entc/integration/template/ent/user.go @@ -37,18 +37,18 @@ type UserEdges struct { loadedTypes [2]bool } -// PetsErr returns the Pets value or an error if the edge +// PetsOrErr returns the Pets value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) PetsErr() ([]*Pet, error) { +func (e UserEdges) PetsOrErr() ([]*Pet, error) { if e.loadedTypes[0] { return e.Pets, nil } return nil, &NotLoadedError{edge: "pets"} } -// FriendsErr returns the Friends value or an error if the edge +// FriendsOrErr returns the Friends value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) FriendsErr() ([]*User, error) { +func (e UserEdges) FriendsOrErr() ([]*User, error) { if e.loadedTypes[1] { return e.Friends, nil } diff --git a/examples/edgeindex/ent/city.go b/examples/edgeindex/ent/city.go index 2d9a7fb1a..a64c449ae 100644 --- a/examples/edgeindex/ent/city.go +++ b/examples/edgeindex/ent/city.go @@ -35,9 +35,9 @@ type CityEdges struct { loadedTypes [1]bool } -// StreetsErr returns the Streets value or an error if the edge +// StreetsOrErr returns the Streets value or an error if the edge // was not loaded in eager-loading. -func (e CityEdges) StreetsErr() ([]*Street, error) { +func (e CityEdges) StreetsOrErr() ([]*Street, error) { if e.loadedTypes[0] { return e.Streets, nil } diff --git a/examples/edgeindex/ent/street.go b/examples/edgeindex/ent/street.go index 548a52e57..0c0db5d5e 100644 --- a/examples/edgeindex/ent/street.go +++ b/examples/edgeindex/ent/street.go @@ -37,9 +37,9 @@ type StreetEdges struct { loadedTypes [1]bool } -// CityErr returns the City value or an error if the edge +// CityOrErr returns the City value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e StreetEdges) CityErr() (*City, error) { +func (e StreetEdges) CityOrErr() (*City, error) { if e.loadedTypes[0] { if e.City == nil { // The edge city was loaded in eager-loading, diff --git a/examples/m2m2types/ent/group.go b/examples/m2m2types/ent/group.go index 5ac9c184b..7c35097cf 100644 --- a/examples/m2m2types/ent/group.go +++ b/examples/m2m2types/ent/group.go @@ -35,9 +35,9 @@ type GroupEdges struct { loadedTypes [1]bool } -// UsersErr returns the Users value or an error if the edge +// UsersOrErr returns the Users value or an error if the edge // was not loaded in eager-loading. -func (e GroupEdges) UsersErr() ([]*User, error) { +func (e GroupEdges) UsersOrErr() ([]*User, error) { if e.loadedTypes[0] { return e.Users, nil } diff --git a/examples/m2m2types/ent/user.go b/examples/m2m2types/ent/user.go index e850aa12f..9da54925d 100644 --- a/examples/m2m2types/ent/user.go +++ b/examples/m2m2types/ent/user.go @@ -37,9 +37,9 @@ type UserEdges struct { loadedTypes [1]bool } -// GroupsErr returns the Groups value or an error if the edge +// GroupsOrErr returns the Groups value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) GroupsErr() ([]*Group, error) { +func (e UserEdges) GroupsOrErr() ([]*Group, error) { if e.loadedTypes[0] { return e.Groups, nil } diff --git a/examples/m2mbidi/ent/user.go b/examples/m2mbidi/ent/user.go index 819fd4963..cb6cc8498 100644 --- a/examples/m2mbidi/ent/user.go +++ b/examples/m2mbidi/ent/user.go @@ -37,9 +37,9 @@ type UserEdges struct { loadedTypes [1]bool } -// FriendsErr returns the Friends value or an error if the edge +// FriendsOrErr returns the Friends value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) FriendsErr() ([]*User, error) { +func (e UserEdges) FriendsOrErr() ([]*User, error) { if e.loadedTypes[0] { return e.Friends, nil } diff --git a/examples/m2mrecur/ent/user.go b/examples/m2mrecur/ent/user.go index 7296477b3..803468867 100644 --- a/examples/m2mrecur/ent/user.go +++ b/examples/m2mrecur/ent/user.go @@ -39,18 +39,18 @@ type UserEdges struct { loadedTypes [2]bool } -// FollowersErr returns the Followers value or an error if the edge +// FollowersOrErr returns the Followers value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) FollowersErr() ([]*User, error) { +func (e UserEdges) FollowersOrErr() ([]*User, error) { if e.loadedTypes[0] { return e.Followers, nil } return nil, &NotLoadedError{edge: "followers"} } -// FollowingErr returns the Following value or an error if the edge +// FollowingOrErr returns the Following value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) FollowingErr() ([]*User, error) { +func (e UserEdges) FollowingOrErr() ([]*User, error) { if e.loadedTypes[1] { return e.Following, nil } diff --git a/examples/o2m2types/ent/pet.go b/examples/o2m2types/ent/pet.go index 9a303aa97..8c8ae3d1f 100644 --- a/examples/o2m2types/ent/pet.go +++ b/examples/o2m2types/ent/pet.go @@ -37,9 +37,9 @@ type PetEdges struct { loadedTypes [1]bool } -// OwnerErr returns the Owner value or an error if the edge +// OwnerOrErr returns the Owner value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e PetEdges) OwnerErr() (*User, error) { +func (e PetEdges) OwnerOrErr() (*User, error) { if e.loadedTypes[0] { if e.Owner == nil { // The edge owner was loaded in eager-loading, diff --git a/examples/o2m2types/ent/user.go b/examples/o2m2types/ent/user.go index bd9d7a3a0..1f439aad0 100644 --- a/examples/o2m2types/ent/user.go +++ b/examples/o2m2types/ent/user.go @@ -37,9 +37,9 @@ type UserEdges struct { loadedTypes [1]bool } -// PetsErr returns the Pets value or an error if the edge +// PetsOrErr returns the Pets value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) PetsErr() ([]*Pet, error) { +func (e UserEdges) PetsOrErr() ([]*Pet, error) { if e.loadedTypes[0] { return e.Pets, nil } diff --git a/examples/o2mrecur/ent/node.go b/examples/o2mrecur/ent/node.go index f7d7600da..f1adf1458 100644 --- a/examples/o2mrecur/ent/node.go +++ b/examples/o2mrecur/ent/node.go @@ -38,9 +38,9 @@ type NodeEdges struct { loadedTypes [2]bool } -// ParentErr returns the Parent value or an error if the edge +// ParentOrErr returns the Parent value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e NodeEdges) ParentErr() (*Node, error) { +func (e NodeEdges) ParentOrErr() (*Node, error) { if e.loadedTypes[0] { if e.Parent == nil { // The edge parent was loaded in eager-loading, @@ -52,9 +52,9 @@ func (e NodeEdges) ParentErr() (*Node, error) { return nil, &NotLoadedError{edge: "parent"} } -// ChildrenErr returns the Children value or an error if the edge +// ChildrenOrErr returns the Children value or an error if the edge // was not loaded in eager-loading. -func (e NodeEdges) ChildrenErr() ([]*Node, error) { +func (e NodeEdges) ChildrenOrErr() ([]*Node, error) { if e.loadedTypes[1] { return e.Children, nil } diff --git a/examples/o2o2types/ent/card.go b/examples/o2o2types/ent/card.go index c0b4c0463..820857982 100644 --- a/examples/o2o2types/ent/card.go +++ b/examples/o2o2types/ent/card.go @@ -40,9 +40,9 @@ type CardEdges struct { loadedTypes [1]bool } -// OwnerErr returns the Owner value or an error if the edge +// OwnerOrErr returns the Owner value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e CardEdges) OwnerErr() (*User, error) { +func (e CardEdges) OwnerOrErr() (*User, error) { if e.loadedTypes[0] { if e.Owner == nil { // The edge owner was loaded in eager-loading, diff --git a/examples/o2o2types/ent/user.go b/examples/o2o2types/ent/user.go index 31374a544..4d3e931d8 100644 --- a/examples/o2o2types/ent/user.go +++ b/examples/o2o2types/ent/user.go @@ -38,9 +38,9 @@ type UserEdges struct { loadedTypes [1]bool } -// CardErr returns the Card value or an error if the edge +// CardOrErr returns the Card value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e UserEdges) CardErr() (*Card, error) { +func (e UserEdges) CardOrErr() (*Card, error) { if e.loadedTypes[0] { if e.Card == nil { // The edge card was loaded in eager-loading, diff --git a/examples/o2obidi/ent/user.go b/examples/o2obidi/ent/user.go index 3f4536cea..240e8405f 100644 --- a/examples/o2obidi/ent/user.go +++ b/examples/o2obidi/ent/user.go @@ -38,9 +38,9 @@ type UserEdges struct { loadedTypes [1]bool } -// SpouseErr returns the Spouse value or an error if the edge +// SpouseOrErr returns the Spouse value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e UserEdges) SpouseErr() (*User, error) { +func (e UserEdges) SpouseOrErr() (*User, error) { if e.loadedTypes[0] { if e.Spouse == nil { // The edge spouse was loaded in eager-loading, diff --git a/examples/o2orecur/ent/node.go b/examples/o2orecur/ent/node.go index 87e41006c..d32886b6f 100644 --- a/examples/o2orecur/ent/node.go +++ b/examples/o2orecur/ent/node.go @@ -38,9 +38,9 @@ type NodeEdges struct { loadedTypes [2]bool } -// PrevErr returns the Prev value or an error if the edge +// PrevOrErr returns the Prev value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e NodeEdges) PrevErr() (*Node, error) { +func (e NodeEdges) PrevOrErr() (*Node, error) { if e.loadedTypes[0] { if e.Prev == nil { // The edge prev was loaded in eager-loading, @@ -52,9 +52,9 @@ func (e NodeEdges) PrevErr() (*Node, error) { return nil, &NotLoadedError{edge: "prev"} } -// NextErr returns the Next value or an error if the edge +// NextOrErr returns the Next value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e NodeEdges) NextErr() (*Node, error) { +func (e NodeEdges) NextOrErr() (*Node, error) { if e.loadedTypes[1] { if e.Next == nil { // The edge next was loaded in eager-loading, diff --git a/examples/start/ent/car.go b/examples/start/ent/car.go index 1319ce4f5..af9d439c4 100644 --- a/examples/start/ent/car.go +++ b/examples/start/ent/car.go @@ -40,9 +40,9 @@ type CarEdges struct { loadedTypes [1]bool } -// OwnerErr returns the Owner value or an error if the edge +// OwnerOrErr returns the Owner value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e CarEdges) OwnerErr() (*User, error) { +func (e CarEdges) OwnerOrErr() (*User, error) { if e.loadedTypes[0] { if e.Owner == nil { // The edge owner was loaded in eager-loading, diff --git a/examples/start/ent/group.go b/examples/start/ent/group.go index 2c5294190..dfad6d57b 100644 --- a/examples/start/ent/group.go +++ b/examples/start/ent/group.go @@ -35,9 +35,9 @@ type GroupEdges struct { loadedTypes [1]bool } -// UsersErr returns the Users value or an error if the edge +// UsersOrErr returns the Users value or an error if the edge // was not loaded in eager-loading. -func (e GroupEdges) UsersErr() ([]*User, error) { +func (e GroupEdges) UsersOrErr() ([]*User, error) { if e.loadedTypes[0] { return e.Users, nil } diff --git a/examples/start/ent/user.go b/examples/start/ent/user.go index 10edc9538..16ed32632 100644 --- a/examples/start/ent/user.go +++ b/examples/start/ent/user.go @@ -39,18 +39,18 @@ type UserEdges struct { loadedTypes [2]bool } -// CarsErr returns the Cars value or an error if the edge +// CarsOrErr returns the Cars value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) CarsErr() ([]*Car, error) { +func (e UserEdges) CarsOrErr() ([]*Car, error) { if e.loadedTypes[0] { return e.Cars, nil } return nil, &NotLoadedError{edge: "cars"} } -// GroupsErr returns the Groups value or an error if the edge +// GroupsOrErr returns the Groups value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) GroupsErr() ([]*Group, error) { +func (e UserEdges) GroupsOrErr() ([]*Group, error) { if e.loadedTypes[1] { return e.Groups, nil } diff --git a/examples/traversal/ent/group.go b/examples/traversal/ent/group.go index ecea45668..9600d9250 100644 --- a/examples/traversal/ent/group.go +++ b/examples/traversal/ent/group.go @@ -39,18 +39,18 @@ type GroupEdges struct { loadedTypes [2]bool } -// UsersErr returns the Users value or an error if the edge +// UsersOrErr returns the Users value or an error if the edge // was not loaded in eager-loading. -func (e GroupEdges) UsersErr() ([]*User, error) { +func (e GroupEdges) UsersOrErr() ([]*User, error) { if e.loadedTypes[0] { return e.Users, nil } return nil, &NotLoadedError{edge: "users"} } -// AdminErr returns the Admin value or an error if the edge +// AdminOrErr returns the Admin value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e GroupEdges) AdminErr() (*User, error) { +func (e GroupEdges) AdminOrErr() (*User, error) { if e.loadedTypes[1] { if e.Admin == nil { // The edge admin was loaded in eager-loading, diff --git a/examples/traversal/ent/pet.go b/examples/traversal/ent/pet.go index 1bd91a08e..19755ece0 100644 --- a/examples/traversal/ent/pet.go +++ b/examples/traversal/ent/pet.go @@ -39,18 +39,18 @@ type PetEdges struct { loadedTypes [2]bool } -// FriendsErr returns the Friends value or an error if the edge +// FriendsOrErr returns the Friends value or an error if the edge // was not loaded in eager-loading. -func (e PetEdges) FriendsErr() ([]*Pet, error) { +func (e PetEdges) FriendsOrErr() ([]*Pet, error) { if e.loadedTypes[0] { return e.Friends, nil } return nil, &NotLoadedError{edge: "friends"} } -// OwnerErr returns the Owner value or an error if the edge +// OwnerOrErr returns the Owner value or an error if the edge // was not loaded in eager-loading, or loaded but was not found. -func (e PetEdges) OwnerErr() (*User, error) { +func (e PetEdges) OwnerOrErr() (*User, error) { if e.loadedTypes[1] { if e.Owner == nil { // The edge owner was loaded in eager-loading, diff --git a/examples/traversal/ent/user.go b/examples/traversal/ent/user.go index a34228755..8959990ee 100644 --- a/examples/traversal/ent/user.go +++ b/examples/traversal/ent/user.go @@ -43,36 +43,36 @@ type UserEdges struct { loadedTypes [4]bool } -// PetsErr returns the Pets value or an error if the edge +// PetsOrErr returns the Pets value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) PetsErr() ([]*Pet, error) { +func (e UserEdges) PetsOrErr() ([]*Pet, error) { if e.loadedTypes[0] { return e.Pets, nil } return nil, &NotLoadedError{edge: "pets"} } -// FriendsErr returns the Friends value or an error if the edge +// FriendsOrErr returns the Friends value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) FriendsErr() ([]*User, error) { +func (e UserEdges) FriendsOrErr() ([]*User, error) { if e.loadedTypes[1] { return e.Friends, nil } return nil, &NotLoadedError{edge: "friends"} } -// GroupsErr returns the Groups value or an error if the edge +// GroupsOrErr returns the Groups value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) GroupsErr() ([]*Group, error) { +func (e UserEdges) GroupsOrErr() ([]*Group, error) { if e.loadedTypes[2] { return e.Groups, nil } return nil, &NotLoadedError{edge: "groups"} } -// ManageErr returns the Manage value or an error if the edge +// ManageOrErr returns the Manage value or an error if the edge // was not loaded in eager-loading. -func (e UserEdges) ManageErr() ([]*Group, error) { +func (e UserEdges) ManageOrErr() ([]*Group, error) { if e.loadedTypes[3] { return e.Manage, nil }