Skip to content

cmd/compile: "import path contains space character" for imports without spaces #20306

Closed

Description

@griesemer

cmd/compile complains if an import path contains a space character. More so, it also complains if a package path (import path after resolving it) contains a space character. This seems overly zealous.

For instance, for a small experiment, I had put two .go files main.go and lib.go in a local directory that happens to be under my Google Drive directory, with the main package containing the local import "./lib". Because this resolves to an absolute path containing "Google Drive" as a component, the import gets rejected.

It's probably useful to reject arbitrary Unicode spaces, but a regular blank ' ' (0x20) character should be ok. Independent of Google Drive, on OS X it is not uncommon to have blanks in folder names.

Activity

  1. added
    NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.
    on May 10, 2017
  2. robpike commented on May 10, 2017

    @robpike
    Contributor

    The spec forbids the import path containing a space and I don't think that should change. What you're asking for is the fully-qualified path name to be allowed to have spaces, and that seems fine.

  3. griesemer commented on May 10, 2017

    @griesemer
    ContributorAuthor

    @robpike Yes, that is what I am asking for.

  4. changed the title [-]cmd/compile: "import path contains space character" overly zealous[/-] [+]cmd/compile: "import path contains space character" for imports without spaces[/+] on May 22, 2017
  5. rsc commented on May 22, 2017

    @rsc
    Contributor

    Fixing this (but still disallowing actual imports with actual spaces) seems fine.

  6. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    on May 22, 2017
  7. removed
    NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.
    on May 22, 2017
  8. self-assigned this
    on May 22, 2017
  9. added this to the Go1.9Maybe milestone on May 22, 2017
  10. gopherbot commented on Jun 16, 2017

    @gopherbot
    Contributor

    CL https://golang.org/cl/46001 mentions this issue.

  11. modified the milestones: Go1.9, Go1.9Maybe on Jun 16, 2017
  12. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions