Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a -d flag that allows parsing a directory instead of an import path #9

Merged
merged 1 commit into from
Mar 6, 2013
Merged

Add a -d flag that allows parsing a directory instead of an import path #9

merged 1 commit into from
Mar 6, 2013

Conversation

dominikh
Copy link
Collaborator

@dominikh dominikh commented Mar 5, 2013

The -d flag takes precedence over an import path.

There are two reasons for adding a -d flag

  • It makes editor integration easier. Every editor knows the directory
    of a given file, not all editors know the import path
  • Being able to parse a directory avoids ambiguity when an import path
    exists in multiple GOPATHs (e.g. when working on someone else's
    package)

@kisielk
Copy link
Owner

kisielk commented Mar 6, 2013

Not sure if I want to have a separate flag for this or not. Doesn't the gotool or godoc handle this automatically?

@dominikh
Copy link
Collaborator Author

dominikh commented Mar 6, 2013

godoc seems to handle absolute paths. If you want me to, I can adjust the PR to differentiate between import paths and absolute paths and drop the -d flag.

@dominikh
Copy link
Collaborator Author

dominikh commented Mar 6, 2013

Hm, I am not too sure how godoc behaves. /foo/bar is considered a file path, foo/bar is not, but ./foo/bar is again.

https://code.google.com/p/go/issues/detail?id=4330 seems to clarify the behaviour.

@dominikh
Copy link
Collaborator Author

dominikh commented Mar 6, 2013

I changed the behaviour to be more like godoc. I rebased the feature branch to have a clean single commit. No more -d flag.

kisielk added a commit that referenced this pull request Mar 6, 2013
Add a -d flag that allows parsing a directory instead of an import path
@kisielk kisielk merged commit 9b98cd6 into kisielk:master Mar 6, 2013
@kisielk
Copy link
Owner

kisielk commented Mar 6, 2013

I'll make the changes myself later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants