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

Removing comments when no imports are declared #14

Closed
nightah opened this issue May 26, 2020 · 2 comments
Closed

Removing comments when no imports are declared #14

nightah opened this issue May 26, 2020 · 2 comments

Comments

@nightah
Copy link

nightah commented May 26, 2020

Thanks again for creating this fantastic tool.

There appears to be an issue in files where no imports are declared, it seems that goimports-reviser is removing all comments that reside within the code, an examples as follows:

package main

// OutputDir the output directory where the built version of Authelia is located.
var OutputDir = "dist"

// DockerImageName the official name of Authelia docker image.
var DockerImageName = "authelia/authelia"

// IntermediateDockerImageName local name of the docker image.
var IntermediateDockerImageName = "authelia:dist"

const masterTag = "master"
const stringFalse = "false"
const stringTrue = "true"
const suitePathPrefix = "PathPrefix"
const webDirectory = "web"

Will turn into the following with a pass of goimports-reviser:

package main

var OutputDir = "dist"

var DockerImageName = "authelia/authelia"

var IntermediateDockerImageName = "authelia:dist"

const masterTag = "master"
const stringFalse = "false"
const stringTrue = "true"
const suitePathPrefix = "PathPrefix"
const webDirectory = "web"
incu6us added a commit that referenced this issue May 26, 2020
@incu6us
Copy link
Owner

incu6us commented May 26, 2020

Hi @nightah,
Thanks for your feedback.
The solution is here v0.1.5

@nightah
Copy link
Author

nightah commented May 26, 2020

Thanks for the prompt response.
I can confirm the issue is fixed, thanks again!

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

No branches or pull requests

2 participants