File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -308,15 +308,9 @@ func StreetAddressToLocation(address string) *contact.Location {
308
308
return nil
309
309
}
310
310
311
- var err error
312
- var loc contact.Location
313
- loc .Address , err = expandAddress (address )
314
- if err != nil {
315
- return nil
316
- }
317
-
311
+ loc := & contact.Location {Address : address }
318
312
parsed , err := parseAddress (loc .Address )
319
- if err != nil || len ( parsed . Parts ) < 4 {
313
+ if err != nil {
320
314
return nil
321
315
}
322
316
@@ -348,11 +342,7 @@ func StreetAddressToLocation(address string) *contact.Location {
348
342
}
349
343
}
350
344
}
351
- if (loc .Building == "" && loc .BuildingNumber == "" ) ||
352
- loc .StreetName == "" || loc .City == "" || loc .Province == "" {
353
- return nil
354
- }
355
- return & loc
345
+ return loc
356
346
}
357
347
358
348
type parsed struct {
@@ -381,6 +371,7 @@ func parseAddress(address string) (*parsed, error) {
381
371
return & p , nil
382
372
}
383
373
374
+ /*
384
375
func expandAddress(address string) (string, error) {
385
376
if postalHost == "" || postalPort == "" {
386
377
return "", errors.New("no postal server information provided")
@@ -408,3 +399,4 @@ func expandAddress(address string) (string, error) {
408
399
}
409
400
return ex.Forms[num-1], nil
410
401
}
402
+ */
You can’t perform that action at this time.
0 commit comments