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

How to avoid go vet copylocks warnings? #39

Closed
1 of 3 tasks
s-takehana opened this issue Dec 13, 2022 · 2 comments
Closed
1 of 3 tasks

How to avoid go vet copylocks warnings? #39

s-takehana opened this issue Dec 13, 2022 · 2 comments
Labels
question Further information is requested

Comments

@s-takehana
Copy link

Have you read the project readme?

  • Yes, but it does not include related information regarding my question.
  • Yes, but the steps described do not work.
  • Yes, but I am having difficulty understanding it and want clarification.

Describe your question
A clear and concise description of what the question is. Include errors and go source files.

How to avoid go vet copylocks warnings?

e.g.

// goverter:converter
type Converter interface {
	Convert(source []Input) []Output
}

// generated gRPC code
type Input struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}

type Output struct {
	Name string
}
goverter -ignoreUnexportedFields ./example/simple

generated.go
image

call of ***** copies lock value: ***** contains google.golang.org/protobuf/internal/impl.MessageState contains sync.Mutex

I want to use pointer.
image

@s-takehana s-takehana added the question Further information is requested label Dec 13, 2022
@waltcow
Copy link

waltcow commented Dec 13, 2022

same issue here
#37 (comment)

@s-takehana
Copy link
Author

Thanks!

@s-takehana s-takehana closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants