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 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@brycekahle
Comment options

Answer selected by christian-2
@thediveo
Comment options

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
4 participants