entc/gen: fix name conflicts in builder setters (#680)

This commit is contained in:
Ariel Mashraki
2020-08-20 12:21:01 +03:00
committed by GitHub
parent 5e56543133
commit fd481554a4
2 changed files with 3 additions and 3 deletions

View File

@@ -226,7 +226,7 @@ func templateBuilderQueryTmpl() (*asset, error) {
return a, nil
}
var _templateBuilderSetterTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x57\x4d\x6f\xdb\x38\x13\x3e\x5b\xbf\x62\x5e\xc1\x2f\x20\x1b\x1b\xba\xed\x6d\x17\xf0\x21\x8d\x5b\xc0\xc0\x36\x05\xd6\xc9\xa9\xe8\x41\x11\x87\x0e\x5b\x85\x54\x49\xca\xbb\x81\x56\xff\x7d\xc1\x2f\x49\x96\x1d\x27\x4e\x77\x6f\x36\x67\x38\x33\x7c\xe6\x99\x0f\x35\xcd\x62\x9e\x5c\xc9\xea\x51\xf1\xed\xbd\x81\x77\x6f\xde\xfe\x7a\x51\x29\xd4\x28\x0c\x7c\xcc\x0b\xbc\x93\xf2\x3b\xac\x45\x41\xe0\xb2\x2c\xc1\x29\x69\xb0\x72\xb5\x43\x4a\x92\x9b\x7b\xae\x41\xcb\x5a\x15\x08\x85\xa4\x08\x5c\x43\xc9\x0b\x14\x1a\x29\xd4\x82\xa2\x02\x73\x8f\x70\x59\xe5\xc5\x3d\xc2\x3b\xf2\x26\x4a\x81\xc9\x5a\xd0\x84\x0b\x27\xff\x7d\x7d\xf5\xe1\x7a\xf3\x01\x18\x2f\x11\xc2\x99\x92\xd2\x00\xe5\x0a\x0b\x23\xd5\x23\x48\x06\x66\xe0\xcc\x28\x44\x92\xcc\x17\x6d\x9b\x24\x4d\x03\x14\x19\x17\x08\xa9\x46\x63\x50\xa5\xd0\xb6\xf6\x74\x7a\x57\xf3\xd2\xc6\xf0\xdb\x12\xaa\x5c\x17\x79\x09\x53\xb2\x29\x64\x85\xe4\x7d\x90\x04\x45\x85\x05\xf2\x9d\xd7\xec\x7e\x77\xd7\x83\x12\xe3\x58\x52\x6d\x55\xa6\xe4\xa3\xff\x1d\x24\x75\x45\x73\xe3\x6f\xb3\xbc\xd4\xe8\xcf\x2f\x80\x33\x90\x0a\xb2\xfb\x5c\x6f\x6a\xc6\xf8\x5f\xbd\xc9\xf4\xd6\x5d\x49\x67\xa7\xa4\x9f\x85\x55\x68\xdb\x64\x32\x74\xb2\x04\xa3\x6a\xec\x8e\x43\x54\x36\xa8\x4f\xb5\xc9\xef\x4a\x1c\xc6\x76\x01\x68\xe3\xe1\x0c\xa6\x64\xbd\x22\xb7\x1a\xd5\xca\x61\x45\x0f\x0d\xe4\x55\x85\x82\x76\x07\xf6\x42\x67\x44\x38\x7d\xfb\x58\x95\x8b\x2d\xc2\x94\x39\x1c\x58\xe7\xca\x99\xaa\xf6\xf1\x63\xe4\xe6\xb1\x42\xb2\x31\x8a\x8b\x6d\xef\xaf\x16\x85\xcb\x88\xe2\xc2\x40\xba\x41\x93\x5a\xd5\x8d\x51\x75\x61\x5c\xec\x4e\x75\xb1\x80\x4e\xbb\x6d\x41\xa3\xd1\x8e\x17\xee\x90\x5c\xe7\x0f\x16\x02\x70\x01\x90\x64\xe2\xd4\xb2\xbd\x54\xb6\x2d\xcc\x87\x24\x68\xdb\xd9\xd0\x62\xe6\x03\x6e\xdb\x60\xd1\x86\xea\x74\x46\x97\xa0\x49\x26\x13\x8b\xc1\x62\x6e\x83\x30\xf6\x29\xa2\x7e\x40\xc5\x0b\x30\xf6\x8e\xdc\xa1\x52\x9c\x22\x54\x0a\x77\x5c\xd6\x1a\x8a\xbc\x2c\x35\x18\x09\x97\x94\x12\x70\x24\xf5\x26\x38\x83\xdc\x21\xec\x81\xb9\x0e\x66\xba\xd4\x3a\xc5\xc9\xe8\x15\xe4\xa1\x36\xb9\xe1\x52\x90\xa6\x89\xa0\xfd\x81\xfa\x28\x6c\xd9\x2c\x78\x0a\x09\x3b\x6d\xec\x00\x0a\x7b\x5b\xa1\xa9\x95\x80\xd1\xbd\x64\xd2\x26\x36\x7d\x8b\x39\xe4\x3b\xc9\x29\x6c\x51\xa0\xf2\x60\xf0\xb2\xb4\xb4\x03\x5f\x7c\x1a\x98\x54\xfd\xa1\x85\x48\x47\x10\x9a\x26\x42\x90\x09\x69\x7a\x1c\x82\xf2\x0c\x32\xe9\x68\xf3\xb9\xb2\x21\xda\x72\x65\x64\x85\x2c\xaf\x4b\x33\xf3\x57\x32\x87\x5f\xc4\x6b\xca\x88\xaf\x94\xa8\x34\xeb\x1f\x1d\x23\xf8\x78\x40\xb7\xe8\xee\x28\xed\x22\xef\xf6\xae\x3f\xc3\x3f\xfb\x28\x2b\xda\xf2\x1d\x0a\xd8\xe5\x65\xed\x1a\xa1\x8d\x57\xf0\x92\x24\x93\x73\xe8\x39\x72\xdc\xd3\x74\xfe\x02\x9e\x4e\x38\x83\xee\xc2\xff\x96\xd6\xbd\x3f\x3f\xe0\xc1\x30\xfd\xf3\x61\xfe\x27\x8e\x83\x4f\xb1\x60\xe2\xb3\x18\xfb\xc1\x20\xa3\x07\xa4\x66\xe4\x4a\x8a\x1d\x2a\x83\xf4\x46\xbe\xcf\xf5\x01\xd1\x8f\x34\x83\x4b\x4a\x4f\x66\x25\x76\x83\x9c\x52\xdd\x3f\xd4\xc8\xfd\xac\x9c\x89\xf8\x6b\x1a\xc2\xf9\x75\xf5\x3a\x48\xfb\x4a\x78\x0e\xba\xab\x12\x73\xf5\x22\xf0\x0a\xab\xe9\xc9\xec\xb9\x2a\xd9\xbf\x82\xdf\xcf\x20\x75\x06\x42\x03\xac\xfa\x71\x84\x7e\x2c\x7f\xa0\x5b\xec\xc7\x91\x74\xf3\x28\xcd\x2d\xa9\xda\xd6\xe3\x3a\x45\x72\x2b\xf8\x0f\x37\x40\x83\xce\xd2\xed\x0d\x41\x25\x36\x4e\x2b\xe3\x54\xef\x77\x8f\x2c\x6e\x11\xb2\x9a\x41\xa6\xb9\xd8\xd6\x65\xae\xac\x4d\x87\xdc\xdf\x61\xcb\x98\x41\xba\x5e\xe9\xa7\x7d\x46\xbb\xc7\xcd\xc6\x3f\xde\xa8\xb3\x35\x8a\x2d\xe4\x33\x9a\x09\x8c\x95\x96\x69\x7d\x8f\xc2\xae\x47\x21\xdd\x62\xac\x11\x0c\x45\x1a\x44\x77\x8f\xc0\xa9\x0f\xd2\x35\xe4\x41\xa0\xba\x73\x78\xde\x78\xed\xa3\xca\x0e\x5f\xef\x9c\xa1\xdf\x90\x38\xd5\x40\x08\xe9\xdc\x0c\xe3\x5b\xaf\x9e\x9b\xc7\x27\x38\xf5\xea\x08\x4e\x8f\xbf\x61\x61\x76\x06\xa7\xd8\x97\xe8\xc1\xe8\x59\xaf\xf4\xc9\xe9\x83\x7b\xa5\x1a\xf2\x7c\x38\x82\xa2\x99\xf1\x14\x7a\x79\x86\xff\x93\x01\xd5\x87\x95\x71\xea\x55\x5f\x98\x3d\x3b\xa5\x38\x7d\x7a\x3e\xb5\x2d\x2c\xc7\x19\x18\x67\x76\xce\xe9\xb9\xd3\xaa\x5f\x51\x4b\xf9\x27\x2a\xc8\x5c\x52\x18\xa4\xff\x27\x6f\x75\xba\x87\x5c\xb7\x75\x73\x06\xf8\xc3\xde\xda\xc3\xc5\x1b\x5a\x42\xba\x4b\xc3\xdf\xa1\x0b\xf6\x74\xcf\x18\xa5\xfc\xc8\x9e\xfb\x6c\x25\x37\xcd\xb8\x58\x87\xb5\x7a\x9c\x05\x3f\xbf\x20\x1f\x69\x10\xc3\xca\x99\x8f\x7c\x9e\xa8\xdb\xbd\x7a\xbc\x68\x4f\xe4\xef\x48\x31\xbb\x78\xc8\x7a\xd5\xad\xb9\xb6\x90\x83\x11\xee\xbf\xcd\x1e\xf2\xef\x98\x7d\xf9\x7a\x94\x8e\xbf\x40\x89\xa2\x9f\xca\xb3\x38\x9e\xb8\x9b\x13\xbc\xef\xd8\x36\xe7\xdc\x6b\x79\xf9\x12\xd2\x6f\x83\x2e\x1c\x5c\xda\x4d\xd7\xcb\xdb\xd6\x7d\xfa\xb8\x61\xd4\xe3\xe6\x98\xcd\xa9\xfe\x12\x95\xbe\x06\x62\x5b\x71\x7f\x48\xd6\xab\x67\xa8\x3c\x86\x82\x53\x4d\x08\x19\x2f\xfb\x7b\xb3\x71\xb1\x80\x4f\xa1\x2b\x82\x37\xda\x33\x8a\x44\x49\x24\x96\xbc\xfb\x86\x85\xf1\x1f\xd9\x08\x21\x69\x24\x79\x21\x69\xa2\xb5\xb8\x01\x1c\x98\x6f\x92\xa7\xde\x15\x1b\x77\xe2\xa7\x79\x08\xfe\x9f\x00\x00\x00\xff\xff\x71\x20\x77\x5f\x96\x10\x00\x00")
var _templateBuilderSetterTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x57\x5d\x6f\xdb\x36\x17\xbe\xb6\x7e\xc5\x79\x05\xbf\x80\x6c\x2c\x74\xdb\xbb\x0d\xf0\x45\x1a\xb7\x80\x81\xb5\x05\xe6\xe6\xaa\xe8\x05\x23\x1e\x39\x6c\x15\x52\x25\x29\x6f\x81\xa6\xff\x3e\xf0\x4b\x92\x65\xc7\x8e\xd3\xed\xce\x26\xcf\x17\x9f\xf3\x9c\x0f\x35\xcd\x62\x9e\xdc\xc8\xea\x51\xf1\xed\xbd\x81\x37\xaf\x5e\xff\x7a\x55\x29\xd4\x28\x0c\xbc\xa7\x39\xde\x49\xf9\x1d\xd6\x22\x27\x70\x5d\x96\xe0\x84\x34\xd8\x7b\xb5\x43\x46\x92\xcf\xf7\x5c\x83\x96\xb5\xca\x11\x72\xc9\x10\xb8\x86\x92\xe7\x28\x34\x32\xa8\x05\x43\x05\xe6\x1e\xe1\xba\xa2\xf9\x3d\xc2\x1b\xf2\x2a\xde\x42\x21\x6b\xc1\x12\x2e\xdc\xfd\xef\xeb\x9b\x77\x1f\x37\xef\xa0\xe0\x25\x42\x38\x53\x52\x1a\x60\x5c\x61\x6e\xa4\x7a\x04\x59\x80\x19\x38\x33\x0a\x91\x24\xf3\x45\xdb\x26\x49\xd3\x00\xc3\x82\x0b\x84\x54\xa3\x31\xa8\x52\x68\x5b\x7b\x3a\xbd\xab\x79\x69\x63\xf8\x6d\x09\x15\xd5\x39\x2d\x61\x4a\x36\xb9\xac\x90\xbc\x0d\x37\x41\x50\x61\x8e\x7c\xe7\x25\xbb\xdf\x9d\x7a\x10\x2a\x38\x96\x4c\x5b\x91\x29\x79\xef\x7f\x87\x9b\xba\x62\xd4\x78\xed\x82\x96\x1a\xfd\xf9\x15\xf0\x02\xa4\x82\xec\x9e\xea\x4d\x5d\x14\xfc\xaf\xde\x64\x7a\xeb\x54\xd2\xd9\xa9\xdb\x4f\xc2\x0a\xb4\x6d\x32\x19\x3a\x59\x82\x51\x35\x76\xc7\x21\x2a\x1b\xd4\x87\xda\xd0\xbb\x12\x87\xb1\x5d\x01\xda\x78\x78\x01\x53\xb2\x5e\x91\x5b\x8d\x6a\xe5\xb0\x62\x87\x06\x68\x55\xa1\x60\xdd\x81\x55\xe8\x8c\x08\x27\x6f\x1f\xab\xa8\xd8\x22\x4c\x0b\x87\x43\xd1\xb9\x72\xa6\xaa\x7d\xfc\x0a\xf2\xf9\xb1\x42\xb2\x31\x8a\x8b\x2d\xb4\x6d\xd3\xd8\x40\xf0\x87\x15\xec\x21\x6f\x5b\xf0\xba\x4b\x48\x77\xb4\xac\x31\x0d\x47\xc1\xa9\x0f\xb2\x16\xb9\x4b\xa3\xe2\xc2\x40\xba\x41\x93\x5a\xfb\x1b\xa3\xea\xdc\xb8\x07\x3b\xd1\xc5\x02\x3a\xe9\xb6\x05\x8d\x46\x3b\x32\xb9\x43\xf2\x91\x3e\x58\xdc\xc0\x45\x4d\x92\x89\x13\xcb\xf6\xf2\xdf\xb6\x30\x1f\x32\xa7\x6d\x67\x43\x8b\x99\x8f\x34\x84\xec\xdf\xe7\x64\x46\x4a\xd0\x24\x93\x89\x05\x6e\x31\xb7\x41\x18\xfb\x7e\x51\x3f\xa0\xe2\x39\x18\xab\x23\x77\xa8\x14\x67\x08\x95\xc2\x1d\x97\xb5\x86\x9c\x96\xa5\x06\x23\xe1\x9a\x31\x02\x8e\xd9\xde\x04\x2f\x80\xba\xb4\x78\x34\x3f\x06\x33\x1d\x1f\x9c\xe0\x64\xf4\x0a\xf2\x50\x1b\x6a\xb8\x14\xa4\x69\x22\x68\x7f\xa0\x3e\x0a\x5b\x36\x0b\x9e\x22\xe0\x27\x8d\x1d\x40\x61\xb5\x15\x9a\x5a\x09\x18\xe9\x25\x93\x36\xb1\xe9\x5b\xcc\x81\xee\x24\x67\xb0\x45\x81\xca\x83\xc1\xcb\xd2\x72\x15\x7c\xc5\x6a\x28\xa4\xea\x0f\x2d\x44\x3a\x82\xe0\x59\x63\x21\xc8\x84\x34\x3d\x0e\x41\x78\x06\x99\x74\x5c\xfb\x54\xd9\x10\x6d\x8d\x17\x64\x85\x05\xad\x4b\x33\xf3\x2a\x99\xc3\x2f\xe2\x35\x2d\x88\x2f\xaf\x28\x34\xeb\x1f\x1d\x23\x78\x7f\x40\xb7\xe8\xee\x28\xed\x22\xef\xf6\xd4\xcf\xf0\xcf\x3e\xca\x5e\x6d\xf9\x0e\x05\x38\xe2\xdb\xee\x69\xe3\x15\xbc\x24\xc9\xe4\x12\x7a\x8e\x1c\xf7\x34\x9d\x3f\x83\xa7\x13\x5e\x40\xa7\xf0\xbf\xa5\x75\xef\xcf\x0f\x78\x30\x4c\xff\x7c\x98\xff\x89\xe3\xe0\x53\x2c\x98\xf8\x2c\xc6\x26\x32\xc8\xe8\x01\xa9\x0b\x72\x23\xc5\x0e\x95\x41\xf6\x59\xbe\xa5\xfa\x80\xe8\x47\x9a\xc1\x35\x63\x27\xb3\x12\xbb\x01\x65\x4c\xf7\x0f\x35\x72\x3f\x2b\x17\x22\xfe\x92\x86\x70\x79\x5d\xbd\x0c\xd2\xbe\x12\xce\x41\x77\x53\x22\x55\xcf\x02\x2f\xb7\x92\x9e\xcc\x9e\xab\xb2\xf8\x57\xf0\xfb\x19\xa4\x2e\x40\x68\x80\x55\x3f\xc3\xd0\xcf\xf2\x77\x6c\x8b\xfd\x0c\x93\x6e\x88\xa5\xd4\x92\x2a\x8e\xac\x29\x92\x5b\xc1\x7f\xb8\xa9\x1b\x64\x96\x6e\xd9\x08\x22\xc3\x49\xc5\x99\xde\xef\x1e\x59\x5c\x3d\x64\x35\x83\x4c\x73\xb1\xad\x4b\xaa\xac\x4d\x87\xdc\xdf\x61\x35\x99\x41\xba\x5e\xe9\xa7\x7d\x46\xbb\xc7\xcd\xc6\x3f\xde\xa8\xb3\x35\x8a\x2d\xe4\x33\x9a\x09\x8c\x95\x96\x69\x7d\x8f\xc2\xae\x47\x21\xdb\x62\xac\x11\x0c\x45\x1a\xae\xee\x1e\x81\x33\x1f\xa4\x6b\xc8\x83\x40\x75\xe7\xf0\xb2\xf1\xda\x47\x95\x1d\xbe\xde\x39\x43\xbf\x56\x71\xa6\x81\x10\xd2\xb9\x19\xc6\xb7\x5e\x9d\x9b\xc7\x27\x38\xf5\xe2\x08\x4e\x8f\xbf\x61\x61\x76\x06\xa7\xd8\x97\xe8\xc1\xe8\x59\xaf\xf4\xc9\xe9\x83\x7b\xa5\x1a\xf2\x7c\x38\x82\xa2\x99\xf1\x14\x7a\x7e\x86\xff\x93\x01\xd5\x87\x95\x71\xe6\x45\x9f\x99\x3d\x3b\xa5\x38\x7b\x7a\x3e\xb5\x2d\x2c\xc7\x19\x18\x67\x76\xce\xd9\xa5\xd3\xaa\xdf\x6b\x4b\xf9\x27\x2a\xc8\x5c\x52\x0a\x48\xff\x4f\x5e\xeb\x74\x0f\xb9\x6e\x55\x3f\xb7\xe4\x9e\x5f\x70\xf7\x8a\x7b\x94\xf2\x23\x7b\xee\xd9\x4a\x6e\x9a\x71\xb1\x0e\x6b\xf5\x38\x0b\x7e\x7e\x41\x3e\xd2\x20\x86\x95\x33\x1f\xf9\x3c\x51\xb7\x7b\xf5\x78\xd5\x9e\xc8\xdf\x91\x62\x76\xf1\x90\xf5\xaa\x5b\x73\x6d\x21\x07\x23\xdc\x7f\xd0\x3d\xd0\xef\x98\x7d\xf9\x7a\x94\x8e\xbf\x40\x89\xa2\x9f\xca\xb3\x38\x9e\xb8\x9b\x13\x3c\xdd\xfb\xb0\xe1\x5e\xca\xdf\x2f\x21\xfd\x36\xe8\xc2\xc1\xa5\xdd\x74\xfd\x7d\xdb\xba\xef\x25\x37\x8c\x7a\xdc\x1c\xb3\x39\xd3\x5f\xa2\xd0\xd7\x40\x6c\x7b\xdd\x1f\x92\xf5\xea\x0c\x95\xc7\x50\x70\xa6\x09\x21\xe3\x65\x7f\x6f\x36\x2e\x16\xf0\x21\x74\x45\xf0\x46\x7b\x46\x91\x78\x13\x89\x25\xef\xbe\x61\x6e\xfc\x97\x39\x42\x48\x1a\x49\x9e\x49\x9a\x68\x2d\x6e\x00\x07\xe6\x9b\xe4\xa9\x77\xc5\xc6\x9d\xf8\x69\x1e\x82\xff\x27\x00\x00\xff\xff\x37\x9e\x70\x0b\xcb\x10\x00\x00")
func templateBuilderSetterTmplBytes() ([]byte, error) {
return bindataRead(
@@ -241,7 +241,7 @@ func templateBuilderSetterTmpl() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "template/builder/setter.tmpl", size: 4246, mode: os.FileMode(420), modTime: time.Unix(1, 0)}
info := bindataFileInfo{name: "template/builder/setter.tmpl", size: 4299, mode: os.FileMode(420), modTime: time.Unix(1, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}

View File

@@ -17,7 +17,7 @@ in the LICENSE file in the root directory of this source tree.
{{- end }}
{{ range $f := $fields }}
{{ $p := receiver $f.Type.String }}
{{ $p := receiver $f.Type.String }}{{ if eq $p $receiver }} {{ $p = "value" }} {{ end }}
{{ $func := print "Set" $f.StructField }}
// {{ $func }} sets the {{ $f.Name }} field.
func ({{ $receiver }} *{{ $builder }}) {{ $func }}({{ $p }} {{ $f.Type }}) *{{ $builder }} {