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

"encoding/gob" gob: type gocv.Mat has no exported fields #38218

Closed
tangtang666 opened this issue Apr 2, 2020 · 1 comment
Closed

"encoding/gob" gob: type gocv.Mat has no exported fields #38218

tangtang666 opened this issue Apr 2, 2020 · 1 comment

Comments

@tangtang666
Copy link

What version of Go are you using (go version)?

$ go version
1.14

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

I want to use a socket to send a pic Gocv.Mat

conn, _ := net.Dial("tcp", "localhost:8090")
encoder := gob.NewEncoder(conn)
//var chip gocv.Mat
fmt.Println("start read pic")
gocv.IMRead("test2/1.png", 0)
img := gocv.NewMat()
fmt.Println("start send pic")
err := encoder.Encode(img)
fmt.Println(err)

What did you expect to see?

What did you see instead?

@mdlayher
Copy link
Member

mdlayher commented Apr 2, 2020

The error is correct. You cannot gob encode a type with no exported fields.

This is not an issue with Go, please see https://github.com/golang/go/wiki/Questions.

@mdlayher mdlayher closed this as completed Apr 2, 2020
@golang golang locked and limited conversation to collaborators Apr 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants