Skip to content

Build failure: type mismatch in contacts_crud.go parameter declarations #371

@RoggeOhta

Description

@RoggeOhta

Description

The project fails to compile on main (commit 4ac0383) due to incorrect grouped parameter declarations in internal/cmd/contacts_crud.go.

Error

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

Root Cause

Two function signatures use Go's grouped parameter shorthand incorrectly:

func contactsApplyPersonName(person *people.Person, givenSet bool, given, familySet bool, family string)
func contactsApplyPersonOrganization(person *people.Person, orgSet bool, org, titleSet bool, title string)

In Go, given, familySet bool declares both given and familySet as bool. The intent is for given to be string. Same issue with org, titleSet bool.

Expected

func contactsApplyPersonName(person *people.Person, givenSet bool, given string, familySet bool, family string)
func contactsApplyPersonOrganization(person *people.Person, orgSet bool, org string, titleSet bool, title string)

Environment

  • Go 1.26.0 / linux/amd64
  • Commit: 4ac0383

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions