gogcli icon indicating copy to clipboard operation
gogcli copied to clipboard

make: *** [Makefile:33: build] Error 1 - fix included

Open shorage opened this issue 9 months ago • 3 comments

github.com/steipete/gogcli/internal/cmd

internal/cmd/contacts_crud.go:258:32: cannot use given (variable of type bool) as string value in argument to strings.TrimSpace internal/cmd/contacts_crud.go:274:30: cannot use org (variable of type bool) as string value in argument to strings.TrimSpace internal/cmd/contacts_crud.go:410:48: cannot use c.Given (variable of type string) as bool value in argument to contactsApplyPersonName internal/cmd/contacts_crud.go:430:54: cannot use c.Organization (variable of type string) as bool value in argument to contactsApplyPersonOrganization make: *** [Makefile:33: build] Error 1

The bug is in the function signatures. In Go, given, familySet bool means both given and familySet are bool — the type applies to both. Same issue with org, titleSet bool.

Run these two commands on your machine:

sed -i 's/givenSet bool, given, familySet bool/givenSet bool, given string, familySet bool/' ~internal/cmd/contacts_crud.go

sed -i 's/orgSet bool, org, titleSet bool/orgSet bool, org string, titleSet bool/' ~internal/cmd/contacts_crud.go

Then make again. The issue is that Go's shorthand given, familySet bool makes both bool, but given needs to be string.

shorage avatar Feb 19 '26 00:02 shorage

Thanks shorage, that worked for me after I changed "bashsed" to "sed" and removed the tiles before "internal".

kuehnberger avatar Feb 19 '26 03:02 kuehnberger

created pull request #328

fbehrens avatar Feb 19 '26 10:02 fbehrens

Closing as duplicate of #371. Keeping #371 open as the canonical issue; current matching fix is #355.

steipete avatar Mar 07 '26 14:03 steipete