Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 99078

"Exported type should have comment or be unexported" golang VS Code

$
0
0

I tried this code in Go:

type Agent struct {
    name string    // Not exported
    categoryId int // Not exported
}

And VS Code reports the following problem:

exported type Agent should have comment or be unexported


The warning is kind of annoying. So I have the following questions:

  • How to get rid of it?
  • What comment should I put?
  • Is there any default comment template for this?

It asks me to put a comment but it does not offer me to add one by default.


Viewing all articles
Browse latest Browse all 99078

Trending Articles