{"fn": "Alice Johnson", "photo": "alice-128.jpg"}
(public *theCard, path string)
| 432 | |
| 433 | // {"fn": "Alice Johnson", "photo": "alice-128.jpg"} |
| 434 | func parsePublic(public *theCard, path string) *card { |
| 435 | var photo *photoStruct |
| 436 | var err error |
| 437 | |
| 438 | if public.Fn == "" && public.Photo == "" { |
| 439 | return nil |
| 440 | } |
| 441 | |
| 442 | if fname := public.Photo; fname != "" { |
| 443 | photo = &photoStruct{Type: public.Type} |
| 444 | dir, _ := filepath.Split(fname) |
| 445 | if dir == "" { |
| 446 | dir = path |
| 447 | } |
| 448 | photo.Data, err = os.ReadFile(filepath.Join(dir, fname)) |
| 449 | if err != nil { |
| 450 | log.Fatal(err) |
| 451 | } |
| 452 | } |
| 453 | |
| 454 | return &card{Fn: public.Fn, Photo: photo} |
| 455 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…