Skip to content

Does cilium/ebpf help with keeping constants and types in sync between Go and C #1342

Closed Answered by brycekahle
christian-2 asked this question in Q&A
Discussion options

You must be logged in to vote

You should look into using go tool cgo -godefs types.go against a file like this:

//go:build ignore

package mypkg

/*
#include "./types.h"
*/
import "C"

type MyGoType C.my_c_type

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@brycekahle
Comment options

Answer selected by christian-2
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants