diff --git a/entc/gen/internal/bindata.go b/entc/gen/internal/bindata.go index d625fd48f..da4915bcd 100644 --- a/entc/gen/internal/bindata.go +++ b/entc/gen/internal/bindata.go @@ -121,7 +121,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _templateBaseTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x57\x5d\x6f\xdb\xb8\x12\x7d\xb6\x7e\xc5\x40\x70\x2f\xa4\xc0\x91\xd2\xbc\xdd\x02\x7d\x48\x73\x9b\x8b\x00\xdd\xec\x02\xe9\xa2\x0f\x45\x51\x30\xd2\x48\x22\x2c\x91\x0a\x49\x25\x31\x04\xfd\xf7\xc5\x90\xfa\xb2\xe2\x26\x69\xda\x7d\x31\x2c\x7e\xcc\x9c\x99\x73\x66\x48\xb6\x6d\x7c\xe4\x9d\xcb\x7a\xa7\x78\x5e\x18\x38\x3d\x79\xfb\xdf\xe3\x5a\xa1\x46\x61\xe0\x82\x25\x78\x23\xe5\x16\x2e\x45\x12\xc1\x59\x59\x82\x5d\xa4\x81\xe6\xd5\x1d\xa6\x91\xf7\xb9\xe0\x1a\xb4\x6c\x54\x82\x90\xc8\x14\x81\x6b\x28\x79\x82\x42\x63\x0a\x8d\x48\x51\x81\x29\x10\xce\x6a\x96\x14\x08\xa7\xd1\xc9\x30\x0b\x99\x6c\x44\xea\x71\x61\xe7\x3f\x5d\x9e\x7f\xbc\xba\xfe\x08\x19\x2f\x11\xfa\x31\x25\xa5\x81\x94\x2b\x4c\x8c\x54\x3b\x90\x19\x98\x99\x33\xa3\x10\x23\xef\x28\xee\x3a\xcf\x6b\x5b\x48\x31\xe3\x02\xc1\xbf\x61\x1a\x7d\xe8\x07\xd7\xf5\x36\x87\x77\xef\x81\x06\x61\x1d\x9d\x4b\x91\xf1\x3c\xfa\x8b\x25\x5b\x96\x23\x2d\x6a\x5b\x30\x58\xd5\x25\x33\x08\x7e\x81\x2c\x45\xe5\xc3\x7a\xd8\x3e\x4d\xf1\xaa\x96\xca\x0c\x53\x71\x0c\x7f\x2a\x8a\x8c\xd5\x75\xc9\x51\x03\x13\x20\x69\x80\x8b\x1c\xa4\x00\xe4\xa6\x40\x05\xb9\x62\x75\x01\x46\xb1\x3b\x54\x9a\x95\x20\x15\xe8\xdb\x12\x34\x96\x36\xa2\xc8\x33\xbb\x1a\x7b\x4b\x59\x23\x92\x80\x10\x47\xd7\x46\x2a\x96\x63\xf4\xa1\xe1\x25\xcd\x74\x5d\x68\xc1\x28\x26\x72\x84\x75\xb6\x81\xb5\xf5\x45\x71\xb9\x3f\x5d\xe7\xad\x68\x6b\x06\xef\xa1\x66\x3a\x61\x25\xfd\xa7\xd1\x38\x06\x37\xd1\x75\x23\x56\xca\x6c\xce\xef\x50\x40\xc6\xb1\x4c\x35\x65\xbb\x6d\xa1\xa9\x6b\x54\xfd\x52\x6b\x36\xf2\x56\x04\x6a\x34\x10\xf4\xcb\xa3\x28\xd2\x86\x22\x0d\x7b\xe8\xad\xb7\x5a\xb5\xed\x31\xdc\x73\x53\x00\x3e\x18\x14\x29\x04\x5c\xa4\xf8\x00\xeb\xe8\x4a\xa6\xa8\xe1\x24\x04\xff\xa2\x11\x89\x4f\xa6\x7c\xbb\xcd\x1f\xc2\x38\x26\xa0\x2b\x1b\x80\xa9\xea\x92\xc2\xaa\x15\x17\x26\x03\x3f\xe5\x8c\x52\x15\xbf\xd1\xb1\xec\xf7\x0c\xe9\x01\xb7\x4b\xa1\x69\x94\xc5\xff\x30\x92\xe5\xcc\x44\x6e\x45\xdb\x02\xe1\xb1\x4e\x2c\xdd\xf4\x35\xa8\xe3\x09\x7f\xb9\x92\x4d\x1d\x6b\x9e\x0b\x66\x1a\x85\x0b\xcf\x71\x0c\x67\x79\xae\x30\x27\x7f\x33\x11\xb0\x7e\x90\x4b\x01\xda\x60\x4d\x62\xb0\xf9\x26\x6b\xc7\x37\xbb\x49\x0c\xf1\xa4\x82\x1f\x81\xb7\x3a\x3b\xd3\x54\x50\x0c\x6a\x8d\x4d\x2a\xf7\x1c\x10\x3b\xee\x8f\x54\xa0\x50\xb0\x8a\xe4\xc7\x84\xb4\xe2\x73\xbf\xc3\x1a\xed\xd8\x49\x1a\x6d\x64\x05\x82\x55\xa8\x23\xb8\x90\x0a\xf0\x81\x55\x75\x89\xef\xbc\x38\xf6\xe2\x78\xf5\x7f\x02\xfa\x61\xe7\xb8\x7e\xbb\x71\x12\x39\x0d\x23\x9a\x1b\x23\x0e\x86\xca\xea\xba\xe8\x4c\xcf\xbf\xae\x9b\xaa\xdf\x1a\x6e\xc0\xd7\x4d\xf5\xdd\x7d\xf9\xe1\x06\x5e\xb0\xeb\x74\x6f\xd7\xa9\x1f\x3a\xc7\xd7\x09\x13\x41\x62\x1e\x36\xf0\x9f\xbb\x90\x80\x5a\x5d\x9e\xe9\x20\x13\x13\x0d\x1b\xcb\xec\xa0\xcc\x89\x9d\xd6\xb3\xe2\x74\x79\x7d\x82\x6a\xa6\x97\xea\x7a\x46\x5b\xdd\xbc\x2a\x29\xa3\x1b\x58\x53\x92\x2f\x08\x3b\xa9\x8a\x8d\x18\xc6\x02\x15\x56\x6d\x7d\x89\xd2\x9e\x71\xea\x59\x29\x26\x52\x68\xb3\x84\xd8\xb6\xc0\x33\x28\x98\xfe\xbc\x0f\x70\x90\xfe\x33\x25\x79\xc5\x2a\x52\xb6\x05\x32\xd6\xa7\x98\x55\xe4\xd3\x45\xd5\x23\x18\x2a\x6a\xec\x36\x62\xd9\x6e\xda\x16\x6e\x1b\x69\x70\x8c\xf9\xb0\x8e\xa5\x4d\x36\xcf\xe6\x79\xec\xba\x45\xbf\xa2\x63\x60\x74\x8a\x2c\x29\x5c\x71\xed\x75\x2b\x02\x10\x1c\x30\xe5\x0c\x38\x8d\x8c\x36\x16\x62\xf9\x99\x56\x26\xc0\xff\x32\x98\xf7\xe7\xae\x5e\xd6\xd3\x1c\xb1\x99\x33\xf6\xdb\x1a\x5b\x1c\xc3\x95\x34\x17\x74\xb8\x7e\x54\xca\xb6\x06\x32\xa5\xe1\xbe\x40\x01\x46\xed\xa8\x4b\x18\x09\x19\x9a\xa4\x00\x06\xba\xc6\x84\x67\x3c\x01\x14\x86\x9b\x1d\x30\x91\x02\x37\x70\xcf\x34\x08\x69\xdc\x29\x3d\x9c\xc8\x29\x33\x8c\xce\xd2\xfe\xe8\xda\xf7\xa3\x8d\x6a\x12\x43\x39\x2c\xd9\x0d\x96\x7d\x9e\x3d\x07\xc9\x2d\xe1\xd4\x6b\x2a\x14\xc6\xe9\x02\xdd\xa0\x30\xa8\x32\x96\x60\xe4\x0a\x3b\x40\x38\xda\xb3\x1c\xba\xdd\x41\xd8\x9b\x24\x17\x7d\x7e\xb2\xca\x44\xd7\x2e\xb5\x81\x3f\xb5\x94\x77\xf0\x66\x86\xde\xdf\x00\x46\x16\x53\xd8\xa3\xb9\xd4\x83\x83\x31\x3b\x0c\x6e\xa4\x2c\x91\x09\xe0\x22\xe5\x09\x33\xe4\xe8\xbe\x40\xdb\x46\x67\x60\x69\xe5\x94\x17\x3b\xd8\xe3\x9e\x8c\x06\xa8\x94\x9b\x0a\xad\x55\x02\xfc\x7d\x03\x72\x4b\x42\x40\xa5\xa2\x60\x11\xe0\x18\x8f\xdc\xf6\x08\xff\x60\x7a\x3b\x62\xac\x98\xde\x52\x3c\xea\x80\xd7\xf9\xc2\xb9\x5f\x07\xb7\xf5\x56\x3c\x5b\x20\x0b\xad\xcc\x7b\x87\x82\x97\xa4\x9f\xe1\x13\x95\xf2\x46\x0d\x5d\x73\x91\x37\x25\x53\x2f\x93\x51\xbf\x78\x2e\xa3\x4a\x2a\xa4\xdc\x51\x69\xa3\x55\xd4\x33\x6a\xda\xf7\xf8\x9b\x05\xb5\x67\xfc\x17\x34\x35\x44\xfa\x03\x59\x0d\x6e\x5e\xad\xac\x29\x93\x4b\x71\x0d\xa6\x5f\xa6\xaf\xfd\x78\x1f\x4b\xec\x4a\x9a\x4f\x92\xa5\xf8\x74\x9b\xc8\xd1\x58\x5c\x29\x31\xc9\xa6\xbe\x50\xda\xad\x40\x77\x9a\x02\xe1\xb6\x41\xb5\x9b\x78\x9c\xdb\x9d\x58\xc4\x34\xc7\x5f\x25\x71\x66\xf9\x95\x14\x5a\x14\xfb\x51\x58\x26\x69\x7c\x8f\x48\xe7\xea\xd5\x34\xf6\x09\x7a\x44\xa2\x33\xfb\x32\x0a\xe7\xd1\x3e\x26\xf0\x9c\xae\x04\x8a\x71\x61\x9e\x64\x30\x51\xc8\x0c\xc6\x4d\x9d\xd2\x21\x42\x95\x28\x95\x2b\x4d\x5b\xaa\xee\xea\x9a\x92\xc1\xf9\x9c\x7d\x6d\x21\x57\x90\x8c\x5e\x34\x64\x8c\x97\x98\xee\xdd\x1c\x37\x70\xc7\x65\xe9\x4e\x72\x99\xb9\xec\x4a\x45\xd6\xdc\x69\xdb\x08\x7e\xdb\xa0\x40\xad\x7b\x79\x2c\x51\x4f\xfa\xa8\x74\x3e\xc8\x63\x75\xaf\x58\xed\xf2\xf3\x2a\xa9\x2c\x9c\xbc\x46\x2a\x53\xdc\x7d\xd8\xa4\x1e\xab\x94\x4a\xe7\x83\x50\xfe\x16\x16\xe8\x21\x58\x3a\xfa\xa2\x98\x7d\x54\x1d\x92\xf2\x23\x80\xce\x52\x30\x6b\xdc\x43\x4b\x8e\x68\x62\x14\xe6\x8f\x48\xff\x19\x79\x2e\x42\x6b\x14\x8e\x02\x5d\x98\x7f\x81\x4c\x97\x91\x2c\x74\xda\xb6\xf1\x11\xe0\x43\xcd\x86\x73\x0b\x48\x05\x56\x72\x90\x97\xf2\x86\x95\x50\x60\x59\xa3\xd2\x11\xd8\xc7\xfc\x78\x69\x3a\x78\x67\x72\xa9\x5d\xdc\x97\x9e\xba\x06\x1f\xb8\x41\xad\xfb\x3d\x8f\x9e\x82\x87\x6f\x69\x16\xe4\xbf\xe0\x92\xdb\x57\xc2\xa3\xeb\x65\x74\xf9\xbf\xe8\x33\x15\x8a\x7b\x67\x6e\x71\xa7\x47\x92\x89\x47\x1a\x88\x79\xaa\x21\x53\xb2\x72\xcc\x52\xcd\x55\xac\xee\x49\xa4\x05\x41\x45\x03\x5f\x7b\x37\x5d\xf7\xcd\x55\x59\xdb\x85\xf0\xf5\xdb\x38\x4a\x6c\x6a\x02\x51\xb1\x2d\x06\xb3\x89\x0d\x9c\x6c\xa0\x44\x11\x54\x61\xe8\xad\xe8\x7d\xe9\xc0\xba\xd7\x4e\x65\x2f\x10\x1a\xde\xd3\x25\x1f\x45\x1a\xe8\x0d\xf0\x34\x9c\xdf\x23\xb4\x37\x0f\xf7\x9f\x00\x00\x00\xff\xff\xb7\xcc\x27\x25\x63\x12\x00\x00") +var _templateBaseTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x57\x5b\x6f\xdc\x36\x13\x7d\x5e\xfd\x8a\x81\xb0\x5f\x20\x39\x6b\xc9\xf1\xdb\x17\x20\x0f\x8e\x1b\x17\x06\x52\xb7\x80\x53\xe4\x21\x08\x0a\x5a\x1a\x49\x84\x25\x52\x26\x29\xdb\x0b\x41\xff\xbd\x18\x52\xb7\x95\x37\x6b\xe7\xd2\x97\xc5\x8a\x97\x99\x33\x73\xce\x0c\xc9\xb6\x8d\x8f\xbc\x73\x59\x6f\x15\xcf\x0b\x03\xa7\x27\x6f\xfe\x7f\x5c\x2b\xd4\x28\x0c\x5c\xb0\x04\x6f\xa4\xbc\x85\x4b\x91\x44\x70\x56\x96\x60\x17\x69\xa0\x79\x75\x8f\x69\xe4\x7d\x2a\xb8\x06\x2d\x1b\x95\x20\x24\x32\x45\xe0\x1a\x4a\x9e\xa0\xd0\x98\x42\x23\x52\x54\x60\x0a\x84\xb3\x9a\x25\x05\xc2\x69\x74\x32\xcc\x42\x26\x1b\x91\x7a\x5c\xd8\xf9\x8f\x97\xe7\x1f\xae\xae\x3f\x40\xc6\x4b\x84\x7e\x4c\x49\x69\x20\xe5\x0a\x13\x23\xd5\x16\x64\x06\x66\xe6\xcc\x28\xc4\xc8\x3b\x8a\xbb\xce\xf3\xda\x16\x52\xcc\xb8\x40\xf0\x6f\x98\x46\x1f\xfa\xc1\x75\x7d\x9b\xc3\xdb\x77\x40\x83\xb0\x8e\xce\xa5\xc8\x78\x1e\xfd\xc5\x92\x5b\x96\x23\x2d\x6a\x5b\x30\x58\xd5\x25\x33\x08\x7e\x81\x2c\x45\xe5\xc3\x7a\xd8\x3e\x4d\xf1\xaa\x96\xca\x0c\x53\x71\x0c\x7f\x2a\x8a\x8c\xd5\x75\xc9\x51\x03\x13\x20\x69\x80\x8b\x1c\xa4\x00\xe4\xa6\x40\x05\xb9\x62\x75\x01\x46\xb1\x7b\x54\x9a\x95\x20\x15\xe8\xbb\x12\x34\x96\x36\xa2\xc8\x33\xdb\x1a\x7b\x4b\x59\x23\x92\x80\x10\x47\xd7\x46\x2a\x96\x63\xf4\xbe\xe1\x25\xcd\x74\x5d\x68\xc1\x28\x26\x72\x84\x75\xb6\x81\xb5\xf5\x45\x71\xb9\x3f\x5d\xe7\xad\x68\x6b\x06\xef\xa0\x66\x3a\x61\x25\xfd\xa7\xd1\x38\x06\x37\xd1\x75\x23\x56\xca\x6c\xce\xef\x51\x40\xc6\xb1\x4c\x35\x65\xbb\x6d\xa1\xa9\x6b\x54\xfd\x52\x6b\x36\xf2\x56\x04\x6a\x34\x10\xf4\xcb\xa3\x28\xd2\x86\x22\x0d\x7b\xe8\xad\xb7\x5a\xb5\xed\x31\x3c\x70\x53\x00\x3e\x1a\x14\x29\x04\x5c\xa4\xf8\x08\xeb\xe8\x4a\xa6\xa8\xe1\x24\x04\xff\xa2\x11\x89\x4f\xa6\x7c\xbb\xcd\x1f\xc2\x38\x26\xa0\x2b\x1b\x80\xa9\xea\x92\xc2\xaa\x15\x17\x26\x03\x3f\xe5\x8c\x52\x15\xff\x4f\xc7\xb2\xdf\x33\xa4\x07\xdc\x2e\x85\xa6\x51\x16\xff\xe3\x48\x96\x33\x13\xb9\x15\x6d\x0b\x84\xc7\x3a\xb1\x74\xd3\xd7\xa0\x8e\x03\xfe\x72\x25\x9b\x3a\xd6\x3c\x17\xcc\x34\x0a\x17\x9e\xe3\x18\xce\xf2\x5c\x61\x4e\xfe\x66\x22\x60\xfd\x20\x97\x02\xb4\xc1\x9a\xc4\x60\xf3\x4d\xd6\x8e\x6f\xb6\x93\x18\xe2\x49\x05\xdf\x02\x6f\x75\x76\xa6\xa9\xa0\x18\xd4\x1a\x9b\x54\xee\x38\x20\x76\xdc\x1f\xa9\x40\xa1\x60\x15\xc9\x8f\x09\x69\xc5\xe7\x7e\x87\x35\xda\xb1\x93\x34\xda\xc8\x0a\x04\xab\x50\x47\x70\x21\x15\xe0\x23\xab\xea\x12\xdf\x7a\x71\xec\xc5\xf1\xea\x77\x02\xfa\x7e\xeb\xb8\x7e\xb3\x71\x12\x39\x0d\x23\x9a\x1b\x23\x0e\x86\xca\xea\xba\xe8\x4c\xcf\xbf\xae\x9b\xaa\xdf\x1a\x6e\xc0\xd7\x4d\xf5\x8f\xfb\xf2\xc3\x0d\xbc\x60\xd7\xe9\xce\xae\x53\x3f\x74\x8e\xaf\x13\x26\x82\xc4\x3c\x6e\xe0\xd5\x7d\x48\x40\xad\x2e\xcf\x74\x90\x89\x89\x86\x8d\x65\x76\x50\xe6\xc4\x4e\xeb\x59\x71\xba\xbc\x1e\xa0\x9a\xe9\xa5\xba\x9e\xd1\x56\x37\xaf\x4a\xca\xe8\x06\xd6\x94\xe4\x0b\xc2\x4e\xaa\x62\x23\x86\xb1\x40\x85\x55\x5b\x5f\xa2\xb4\x67\x9c\x7a\x56\x8a\x89\x14\xda\x2c\x21\xb6\x2d\xf0\x0c\x0a\xa6\x3f\xed\x02\x1c\xa4\xff\x4c\x49\x5e\xb1\x8a\x94\x6d\x81\x8c\xf5\x29\x66\x15\x79\xb8\xa8\x7a\x04\x43\x45\x8d\xdd\x46\x2c\xdb\x4d\xdb\xc2\x5d\x23\x0d\x8e\x31\xef\xd7\xb1\xb4\xc9\xe6\xd9\x3c\x8f\x5d\xb7\xe8\x57\x74\x0c\x8c\x4e\x91\x25\x85\x2b\xae\x9d\x6e\x45\x00\x82\x3d\xa6\x9c\x01\xa7\x91\xd1\xc6\x42\x2c\xdf\xd3\xca\x04\xf8\x9f\x07\xf3\xfe\xdc\xd5\xcb\x7a\x9a\x23\x36\x73\xc6\x7e\x59\x63\x8b\x63\xb8\x92\xe6\x82\x0e\xd7\x0f\x4a\xd9\xd6\x40\xa6\x34\x3c\x14\x28\xc0\xa8\x2d\x75\x09\x23\x21\x43\x93\x14\xc0\x40\xd7\x98\xf0\x8c\x27\x80\xc2\x70\xb3\x05\x26\x52\xe0\x06\x1e\x98\x06\x21\x8d\x3b\xa5\x87\x13\x39\x65\x86\xd1\x59\xda\x1f\x5d\xbb\x7e\xb4\x51\x4d\x62\x28\x87\x25\xbb\xc1\xb2\xcf\xb3\xe7\x20\xb9\x25\x9c\x7a\x4d\x85\xc2\x38\x5d\xa0\x1b\x14\x06\x55\xc6\x12\x8c\x5c\x61\x07\x08\x47\x3b\x96\x43\xb7\x3b\x08\x7b\x93\xe4\xa2\xcf\x8f\x3f\xb5\x91\xb7\xe0\xc3\x6b\xc0\xc8\x39\x7f\x0d\xfe\x04\xdf\xef\x41\x5c\xea\xc1\xee\x98\x14\x06\x37\x52\x96\xc8\x04\x70\x91\xf2\x84\x19\xb2\xff\x50\xa0\xed\x9e\x33\x8c\xb4\x72\x4a\x87\x1d\xec\xe1\x4e\x46\x03\x54\xca\x4d\x85\xd6\x2a\xe1\xbc\x67\x0a\x96\xf1\x8c\xe8\x1f\xed\x62\x4d\xed\x10\x95\xda\xc0\x2b\x0c\x7b\xa4\x7f\x30\x7d\x3b\x62\xad\x98\xbe\x25\x32\xd4\x1e\xef\xf3\x85\x73\xff\x0e\x76\xeb\xad\x78\xb6\x40\x18\x5a\x95\xf7\x08\x04\x2f\x49\x3e\xc3\x27\x2a\xe5\x8d\x12\xba\xe6\x22\x6f\x4a\xa6\x5e\xa6\xa2\x7e\xf1\x5c\x45\x95\x54\x48\x39\xa4\xca\x46\x2b\xa8\x67\xc4\xb4\xeb\xf1\x17\xeb\x69\xc7\xf8\xcf\x48\x6a\x08\x75\x47\x55\x83\xf5\x1f\x16\xd6\x94\xc0\xa5\xb6\x06\xd3\x87\xe5\xb5\x13\xde\x0b\x14\x76\x25\xcd\x47\xc9\x52\x3c\xdc\x24\x72\x34\x16\x5f\x4a\x44\xb2\xa9\x2b\x94\x76\x2b\xd0\x8d\xa6\x40\xb8\x6b\x50\x6d\x27\x1a\xe7\x76\x27\x12\x31\xcd\xf1\x67\x39\x9c\x59\xfe\x3e\x06\xad\x73\x22\xd0\xfe\xd9\x8d\x62\x87\x47\xe7\xe1\x87\x59\xec\xf3\xf2\x84\x43\x67\xf6\x30\x83\xb3\xe0\x5e\xc0\xdf\x39\xdd\x07\x14\xe3\xc2\x1c\x24\x30\x51\xc8\x0c\xc6\x4d\x9d\xd2\x09\x42\x75\x28\x95\x2b\x4c\x5b\xa8\xee\xde\x9a\x92\xc1\xf9\x9c\x7d\x6a\x21\x57\x90\x8c\x5e\x34\x64\x8c\x97\x98\xee\x5c\x1b\x37\x70\xcf\x65\xe9\x8e\x71\x99\xb9\xe4\x4a\x45\xd6\xdc\x51\xdb\x08\x7e\xd7\xa0\x40\xad\x7b\x75\x2c\x51\x4f\xf2\xa8\x74\x3e\xa8\x63\xf5\xa0\x58\xed\xf2\xf4\x43\x4a\x59\x38\x79\xa9\x52\xa6\x58\xfb\x50\x07\xf1\x54\x7a\x50\xec\xdf\xc2\x42\xdb\x07\x44\x47\x9f\x15\xb3\x6f\xa8\x7d\xda\x7d\x02\xc9\x59\x0a\x66\x8d\x7a\x68\xc1\x11\x4d\x8c\x92\xfc\x16\xcd\xdf\x23\xcc\x45\x60\x8d\xc2\x51\x9a\x0b\xf3\x07\x04\xba\x58\xf9\x9c\x42\xdb\x36\x3e\x02\x7c\xac\xd9\x70\x5e\x01\xf1\x6f\xc5\x06\x79\x29\x6f\x58\x09\x05\x96\x35\x2a\x1d\x81\x7d\xc3\x8f\x77\xa5\xbd\x57\x25\xe7\x64\x71\x4d\x3a\x74\xfb\xdd\x73\x71\x5a\xf7\x7b\x9e\xbc\x00\xf7\x5f\xce\x2c\xc8\xff\xc0\x25\xb7\x8f\x83\x27\xb7\xca\xe8\xf2\xb7\xe8\x13\x95\x88\x7b\x5e\xde\xe2\x56\x8f\x64\x13\x9f\x34\x10\xf3\x54\x43\xa6\x64\xe5\x18\xa6\x6a\xab\x58\xdd\x93\x49\x0b\x82\x8a\x06\xbe\xf4\x6e\xba\xee\xab\xab\xaf\xb6\x0b\xe1\xcb\xd7\x71\x94\x58\xd5\x04\xa2\x62\xb7\x18\xcc\x26\x36\x70\xb2\x81\x12\x45\x50\x85\xa1\xb7\xa2\x67\xa5\x03\xeb\x1e\x39\x95\xbd\x38\x68\x78\x47\x77\x7b\x14\x69\xa0\x37\xc0\xd3\x70\x7e\x7f\xd0\xde\x3c\xdc\x7f\x03\x00\x00\xff\xff\xfb\x72\x07\x88\x5a\x12\x00\x00") func templateBaseTmplBytes() ([]byte, error) { return bindataRead( @@ -136,7 +136,7 @@ func templateBaseTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/base.tmpl", size: 4707, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/base.tmpl", size: 4698, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -881,7 +881,7 @@ func templateHeaderTmpl() (*asset, error) { return a, nil } -var _templateImportTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x53\xcd\x6a\xdc\x4c\x10\x3c\xaf\x9e\xa2\x10\x7b\xb0\xcd\xe7\x91\x3f\xdf\x62\xf0\xc1\x18\x1b\x0c\x21\x18\xec\x7b\x98\x9d\x69\x49\x8d\xa5\x69\x65\xa6\xd7\x89\x11\x7a\xf7\x30\x5a\x6d\x76\xcd\x12\x72\x52\xb5\xaa\xfa\x67\xfa\x67\x1c\xab\x8b\xe2\x5e\x86\x8f\xc8\x4d\xab\xb8\xbe\xfa\xff\xcb\xe5\x10\x29\x51\x50\x3c\x5a\x47\x1b\x91\x37\x3c\x05\x67\x70\xd7\x75\x98\x45\x09\x99\x8f\xef\xe4\x4d\xf1\xda\x72\x42\x92\x6d\x74\x04\x27\x9e\xc0\x09\x1d\x3b\x0a\x89\x3c\xb6\xc1\x53\x84\xb6\x84\xbb\xc1\xba\x96\x70\x6d\xae\xf6\x2c\x6a\xd9\x06\x5f\x70\x98\xf9\xaf\x4f\xf7\x0f\xdf\x5e\x1e\x50\x73\x47\x58\xfe\x45\x11\x85\xe7\x48\x4e\x25\x7e\x40\x6a\xe8\x51\x32\x8d\x44\xa6\xb8\xa8\xa6\xa9\x28\xc6\x11\x9e\x6a\x0e\x84\x92\xfb\x41\xa2\x96\x98\xa6\x62\x07\x71\x56\xac\xca\xba\xd7\xb2\x58\x95\x4e\x82\xd2\xaf\x19\x52\x8c\x12\x53\x46\xbd\xd5\x36\x7f\x93\x46\x27\xe1\x7d\x81\x1c\x9a\x99\x55\xee\xa9\x2c\x56\xe3\x78\x89\xea\x02\xdc\x04\x89\x84\x86\x02\x45\xe5\xd0\x40\x02\x9a\x68\x87\x16\x69\x20\xc7\x35\xd7\x0e\x4a\xfd\xd0\x59\xa5\x84\xb9\xb8\xd9\x95\x6b\x04\x51\x9c\xd1\x0f\xac\xcd\xbd\x84\x9a\x1b\xf3\x6c\xdd\x9b\x6d\x08\xeb\x3d\x3a\xcf\x45\xaf\x56\xe5\x38\x9e\x8a\xa6\xa9\x1a\x22\x79\x76\x56\x73\x39\x7f\x15\xcd\xbf\x0f\x76\x96\xe6\xfc\x3f\x59\xdb\x83\xfe\xc5\xb5\xd4\x5b\xec\xd2\xcd\xa1\xcc\x91\x96\x82\xdf\x31\xd9\x88\x36\xe4\x12\xbf\xff\x87\x75\x8d\x9b\x5b\xac\xcd\x23\x53\xe7\xd3\xe2\x7b\x88\x5d\x9b\xd7\x8f\x81\xcc\xf3\x5b\xf3\x6c\xb5\x5d\xe8\x4f\xb1\x4f\x83\xef\x8d\x63\x5c\x36\xac\xed\x76\x63\x9c\xf4\x55\xbd\xac\x1f\x07\xb7\xdd\x58\x95\x58\x51\x98\x87\xf7\x2f\x4d\xe5\xd9\x76\xe4\x74\x19\xdc\xf2\xfa\x17\x95\xb8\x6b\xcb\xe9\xe3\x96\x5d\xb9\xb9\x85\x79\x9a\x61\x3a\xea\xce\x9e\x3d\xed\xd1\x67\xfc\x67\xf4\xfb\x35\x4c\x95\xf5\x9e\x95\x25\xd8\xae\xc4\x3a\xcb\xce\xf3\xb2\x2e\x2e\x45\xbe\x3d\xdc\x1d\xdc\xb4\xb5\x0a\x67\x03\x36\x04\x79\xa7\x18\xd9\x93\xcf\xe7\x20\x71\x3e\x24\x81\xf5\x1e\x87\x98\x58\xd2\x64\x66\xd8\x0d\x3d\x99\x79\xeb\x4e\x2e\xe2\x73\x29\xd3\x34\x8e\x14\xfc\x34\x15\xbf\x03\x00\x00\xff\xff\x2e\x6e\xc7\x74\xff\x03\x00\x00") +var _templateImportTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x53\x4f\x4b\xe4\x4e\x10\x3d\x4f\x3e\x45\x11\xe6\xa0\xf2\xb3\xe3\xcf\xdb\x0a\x1e\x44\x14\x84\x65\x11\xf4\xbe\xf4\x74\x57\x92\xc2\xa4\x2b\x5b\x5d\xe3\x2a\x21\xdf\x7d\xe9\x4e\xc6\x99\x61\x58\xf6\x94\xd7\xfd\x5e\xfd\x49\xf5\xab\x71\xac\x2e\x8a\x7b\x1e\x3e\x85\x9a\x56\xe1\xfa\xea\xff\x6f\x97\x83\x60\xc4\xa0\xf0\x68\x1d\x6e\x98\xdf\xe0\x29\x38\x03\x77\x5d\x07\x59\x14\x21\xf1\xf2\x8e\xde\x14\xaf\x2d\x45\x88\xbc\x15\x87\xe0\xd8\x23\x50\x84\x8e\x1c\x86\x88\x1e\xb6\xc1\xa3\x80\xb6\x08\x77\x83\x75\x2d\xc2\xb5\xb9\xda\xb1\x50\xf3\x36\xf8\x82\x42\xe6\xbf\x3f\xdd\x3f\xfc\x78\x79\x80\x9a\x3a\x84\xe5\x4e\x98\x15\x3c\x09\x3a\x65\xf9\x04\xae\x41\x0f\x8a\xa9\x20\x9a\xe2\xa2\x9a\xa6\xa2\x18\x47\xf0\x58\x53\x40\x28\xa9\x1f\x58\xb4\x84\x69\x2a\x66\x08\x67\xc5\xaa\xac\x7b\x2d\x8b\x55\xe9\x38\x28\x7e\x64\x88\x22\x2c\x31\xa1\xde\x6a\x9b\xbe\x51\xc5\x71\x78\x5f\x20\x85\x26\xb3\x4a\x3d\x96\xc5\x6a\x1c\x2f\xa1\xba\x00\x6a\x02\x0b\x42\x83\x01\x45\x29\x34\xc0\x01\x1a\xb1\x43\x0b\x71\x40\x47\x35\xd5\x0e\x14\xfb\xa1\xb3\x8a\x11\x72\x73\x39\x94\x6a\x08\xac\x70\x86\xbf\x60\x6d\xee\x39\xd4\xd4\x98\x67\xeb\xde\x6c\x83\xb0\xde\xa1\xf3\xd4\xf4\x6a\x55\x8e\xe3\xa9\x68\x9a\xaa\x41\xd0\x93\xb3\x9a\xda\xf9\xab\x28\x5f\xef\xcf\x49\x9a\xea\xff\x26\x6d\xf7\xfa\x17\xd7\x62\x6f\x61\x2e\x97\x53\x99\x03\x2d\x06\x3f\x33\xe9\x20\x36\xa4\x16\x7f\xfe\x07\xeb\x1a\x6e\x6e\x61\x6d\x1e\x09\x3b\x1f\x97\xd8\x7d\xee\xda\xbc\x7e\x0e\x68\x9e\xdf\x9a\x67\xab\xed\x42\x1f\xe5\x3e\x4d\xbe\x3b\x1c\xe2\xb2\x21\x6d\xb7\x1b\xe3\xb8\xaf\xea\xc5\x7e\x14\xdc\x76\x63\x95\xa5\xc2\x90\x1f\xef\x5f\x9a\xca\x93\xed\xd0\xcd\x5a\xee\x6c\x68\x0c\x4b\x53\x7d\x54\x1f\x5f\xcf\x7e\x30\x95\x17\x65\x99\xc7\x75\xfa\xd3\x8b\x87\x6e\x6e\xc1\x3c\x65\x18\x0f\xa6\xb6\x63\x4f\x67\x77\x8c\xbf\x2c\xb1\xb3\x67\xac\xac\xf7\xa4\xc4\xc1\x76\x25\xac\x93\xec\x3c\x99\x78\x09\x29\xd2\x4e\xc2\xdd\x3e\x4c\x5b\xab\xe0\x6c\x80\x0d\x02\xbf\xa3\x08\x79\xf4\x69\x4d\x58\xf2\x82\x31\x58\xef\x61\x9f\x13\x96\x32\x89\x19\x66\x33\x44\x93\xdd\x78\xb2\x29\xc7\xad\x4c\xd3\x38\x62\xf0\xd3\x54\xfc\x09\x00\x00\xff\xff\xa5\x33\x84\x1e\x17\x04\x00\x00") func templateImportTmplBytes() ([]byte, error) { return bindataRead( @@ -896,7 +896,7 @@ func templateImportTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/import.tmpl", size: 1023, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/import.tmpl", size: 1047, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template/base.tmpl b/entc/gen/template/base.tmpl index 317a7f50f..3f34e4da3 100644 --- a/entc/gen/template/base.tmpl +++ b/entc/gen/template/base.tmpl @@ -66,13 +66,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("{{ $pkg }}: %s not found", e.label) + return "{{ $pkg }}: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -90,13 +90,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("{{ $pkg }}: %s not singular", e.label) + return "{{ $pkg }}: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -106,13 +106,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("{{ $pkg }}: %s edge was not loaded", e.edge) + return "{{ $pkg }}: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -125,7 +125,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("{{ $pkg }}: constraint failed: %s", e.msg) + return "{{ $pkg }}: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -135,8 +135,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } {{/* expand error types and global helpers. */}} diff --git a/entc/gen/template/import.tmpl b/entc/gen/template/import.tmpl index 042084222..7c61d7b82 100644 --- a/entc/gen/template/import.tmpl +++ b/entc/gen/template/import.tmpl @@ -28,6 +28,7 @@ import ( {{- end }} "github.com/facebookincubator/ent" "github.com/facebookincubator/ent/dialect" + "golang.org/x/xerrors" {{- with $.Storage }} {{- range $_, $import := .Imports }} "{{ $import }}" diff --git a/entc/integration/config/ent/ent.go b/entc/integration/config/ent/ent.go index f6486aece..92e23bee0 100644 --- a/entc/integration/config/ent/ent.go +++ b/entc/integration/config/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/entc/integration/customid/ent/ent.go b/entc/integration/customid/ent/ent.go index 5da69707e..c2b57d713 100644 --- a/entc/integration/customid/ent/ent.go +++ b/entc/integration/customid/ent/ent.go @@ -15,6 +15,7 @@ import ( "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" "github.com/google/uuid" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -95,13 +96,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -119,13 +120,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -135,13 +136,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -154,7 +155,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -164,8 +165,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/entc/integration/ent/ent.go b/entc/integration/ent/ent.go index e9566cdec..f92791107 100644 --- a/entc/integration/ent/ent.go +++ b/entc/integration/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/entc/integration/gremlin/ent/ent.go b/entc/integration/gremlin/ent/ent.go index 13e2108c5..73c520322 100644 --- a/entc/integration/gremlin/ent/ent.go +++ b/entc/integration/gremlin/ent/ent.go @@ -15,6 +15,7 @@ import ( "github.com/facebookincubator/ent/dialect/gremlin/encoding/graphson" "github.com/facebookincubator/ent/dialect/gremlin/graph/dsl" "github.com/facebookincubator/ent/dialect/gremlin/graph/dsl/__" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -142,13 +143,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -166,13 +167,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -182,13 +183,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -201,7 +202,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -211,8 +212,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } // Code implements the dsl.Node interface. diff --git a/entc/integration/idtype/ent/ent.go b/entc/integration/idtype/ent/ent.go index b31a5bfb7..02119bb11 100644 --- a/entc/integration/idtype/ent/ent.go +++ b/entc/integration/idtype/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/entc/integration/json/ent/ent.go b/entc/integration/json/ent/ent.go index f6486aece..92e23bee0 100644 --- a/entc/integration/json/ent/ent.go +++ b/entc/integration/json/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/entc/integration/migrate/entv1/ent.go b/entc/integration/migrate/entv1/ent.go index 740bcf60c..29884006f 100644 --- a/entc/integration/migrate/entv1/ent.go +++ b/entc/integration/migrate/entv1/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("entv1: %s not found", e.label) + return "entv1: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("entv1: %s not singular", e.label) + return "entv1: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("entv1: %s edge was not loaded", e.edge) + return "entv1: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("entv1: constraint failed: %s", e.msg) + return "entv1: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/entc/integration/migrate/entv2/ent.go b/entc/integration/migrate/entv2/ent.go index 623d5795d..f1b8104eb 100644 --- a/entc/integration/migrate/entv2/ent.go +++ b/entc/integration/migrate/entv2/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("entv2: %s not found", e.label) + return "entv2: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("entv2: %s not singular", e.label) + return "entv2: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("entv2: %s edge was not loaded", e.edge) + return "entv2: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("entv2: constraint failed: %s", e.msg) + return "entv2: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/entc/integration/template/ent/ent.go b/entc/integration/template/ent/ent.go index f6486aece..92e23bee0 100644 --- a/entc/integration/template/ent/ent.go +++ b/entc/integration/template/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/examples/edgeindex/ent/ent.go b/examples/edgeindex/ent/ent.go index f6486aece..92e23bee0 100644 --- a/examples/edgeindex/ent/ent.go +++ b/examples/edgeindex/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/examples/entcpkg/ent/ent.go b/examples/entcpkg/ent/ent.go index f6486aece..92e23bee0 100644 --- a/examples/entcpkg/ent/ent.go +++ b/examples/entcpkg/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/examples/m2m2types/ent/ent.go b/examples/m2m2types/ent/ent.go index f6486aece..92e23bee0 100644 --- a/examples/m2m2types/ent/ent.go +++ b/examples/m2m2types/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/examples/m2mbidi/ent/ent.go b/examples/m2mbidi/ent/ent.go index f6486aece..92e23bee0 100644 --- a/examples/m2mbidi/ent/ent.go +++ b/examples/m2mbidi/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/examples/m2mrecur/ent/ent.go b/examples/m2mrecur/ent/ent.go index f6486aece..92e23bee0 100644 --- a/examples/m2mrecur/ent/ent.go +++ b/examples/m2mrecur/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/examples/o2m2types/ent/ent.go b/examples/o2m2types/ent/ent.go index f6486aece..92e23bee0 100644 --- a/examples/o2m2types/ent/ent.go +++ b/examples/o2m2types/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/examples/o2mrecur/ent/ent.go b/examples/o2mrecur/ent/ent.go index f6486aece..92e23bee0 100644 --- a/examples/o2mrecur/ent/ent.go +++ b/examples/o2mrecur/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/examples/o2o2types/ent/ent.go b/examples/o2o2types/ent/ent.go index f6486aece..92e23bee0 100644 --- a/examples/o2o2types/ent/ent.go +++ b/examples/o2o2types/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/examples/o2obidi/ent/ent.go b/examples/o2obidi/ent/ent.go index f6486aece..92e23bee0 100644 --- a/examples/o2obidi/ent/ent.go +++ b/examples/o2obidi/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/examples/o2orecur/ent/ent.go b/examples/o2orecur/ent/ent.go index f6486aece..92e23bee0 100644 --- a/examples/o2orecur/ent/ent.go +++ b/examples/o2orecur/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/examples/start/ent/ent.go b/examples/start/ent/ent.go index f6486aece..92e23bee0 100644 --- a/examples/start/ent/ent.go +++ b/examples/start/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/examples/traversal/ent/ent.go b/examples/traversal/ent/ent.go index f6486aece..92e23bee0 100644 --- a/examples/traversal/ent/ent.go +++ b/examples/traversal/ent/ent.go @@ -14,6 +14,7 @@ import ( "github.com/facebookincubator/ent/dialect" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/ent/dialect/sql/sqlgraph" + "golang.org/x/xerrors" ) // Order applies an ordering on either graph traversal or sql selector. @@ -94,13 +95,13 @@ type NotFoundError struct { // Error implements the error interface. func (e *NotFoundError) Error() string { - return fmt.Sprintf("ent: %s not found", e.label) + return "ent: " + e.label + " not found" } // IsNotFound returns a boolean indicating whether the error is a not found error. func IsNotFound(err error) bool { - _, ok := err.(*NotFoundError) - return ok + var e *NotFoundError + return xerrors.As(err, &e) } // MaskNotFound masks nor found error. @@ -118,13 +119,13 @@ type NotSingularError struct { // Error implements the error interface. func (e *NotSingularError) Error() string { - return fmt.Sprintf("ent: %s not singular", e.label) + return "ent: " + e.label + " not singular" } // IsNotSingular returns a boolean indicating whether the error is a not singular error. func IsNotSingular(err error) bool { - _, ok := err.(*NotSingularError) - return ok + var e *NotSingularError + return xerrors.As(err, &e) } // NotLoadedError returns when trying to get a node that was not loaded by the query. @@ -134,13 +135,13 @@ type NotLoadedError struct { // Error implements the error interface. func (e *NotLoadedError) Error() string { - return fmt.Sprintf("ent: %s edge was not loaded", e.edge) + return "ent: " + e.edge + " edge was not loaded" } // IsNotLoaded returns a boolean indicating whether the error is a not loaded error. func IsNotLoaded(err error) bool { - _, ok := err.(*NotLoadedError) - return ok + var e *NotLoadedError + return xerrors.As(err, &e) } // ConstraintError returns when trying to create/update one or more entities and @@ -153,7 +154,7 @@ type ConstraintError struct { // Error implements the error interface. func (e ConstraintError) Error() string { - return fmt.Sprintf("ent: constraint failed: %s", e.msg) + return "ent: constraint failed: " + e.msg } // Unwrap implements the errors.Wrapper interface. @@ -163,8 +164,8 @@ func (e *ConstraintError) Unwrap() error { // IsConstraintError returns a boolean indicating whether the error is a constraint failure. func IsConstraintError(err error) bool { - _, ok := err.(*ConstraintError) - return ok + var e *ConstraintError + return xerrors.As(err, &e) } func isSQLConstraintError(err error) (*ConstraintError, bool) { diff --git a/go.mod b/go.mod index 8d7088bd2..565f54a50 100644 --- a/go.mod +++ b/go.mod @@ -27,4 +27,5 @@ require ( go.opencensus.io v0.22.0 golang.org/x/sync v0.0.0-20190423024810-112230192c58 golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a + golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 ) diff --git a/go.sum b/go.sum index 3d07792eb..60341ef46 100644 --- a/go.sum +++ b/go.sum @@ -35,8 +35,6 @@ github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o= -github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= @@ -91,10 +89,9 @@ golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190514171724-faff00d7e7f6 h1:MfRv9P1q9msQtpNPKv0olEj2ueVViE36KqlG4Br8bAs= -golang.org/x/tools v0.0.0-20190514171724-faff00d7e7f6/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a h1:TwMENskLwU2NnWBzrJGEWHqSiGUkO/B4rfyhwqDxDYQ= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=