Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

Don't force the package to 'main' if the '-o' option was used. #67

Closed
wants to merge 1 commit into from

Conversation

al45tair
Copy link

It looks like the problem is that pkger gets the information for the current
directory, then appends the path from the '-o' option, but that means that
the package name will always be main if it's started from the main package,
regardless of '-o'.

Fixes #56.

@al45tair
Copy link
Author

al45tair commented Mar 4, 2020

@markbates Any chance you could take a look at this and (hopefully) merge it?

cmd/pkger/cmds/pack.go Outdated Show resolved Hide resolved
cmd/pkger/cmds/pack.go Outdated Show resolved Hide resolved
Copy link
Owner

@markbates markbates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can also please add tests around this to prevent regression? Thanks.

It looks like the problem is that pkger gets the information for the current
directory, *then* appends the path from the '-o' option, but that means that
the package name will always be main if it's started from the main package,
regardless of '-o'.

Fixes markbates#56.
@al45tair
Copy link
Author

al45tair commented Mar 4, 2020

Can also please add tests around this to prevent regression? Thanks.

I don't think, having reviewed the repo, that there are any existing tests for the things in the cmd directory (and I note that when you made the change that resulted in this problem, you didn't add any regression tests).

I'm not averse to adding something, but you'll have to be reasonably specific about what you want and where you want it. If I make decisions about your project layout for you, my guess is that you're likely to reject them, which will result in unnecessary back and forth and wasted time at my end, which neither of us really wants.

@al45tair
Copy link
Author

Guess this is officially "fixed".

@al45tair al45tair closed this Mar 11, 2020
@al45tair al45tair deleted the fix-o-option branch March 11, 2020 19:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uses package main even with -o
2 participants