Created
September 27, 2023 00:44
-
-
Save mem/83f6c9bb82cf7ea2eeea5668d596068f to your computer and use it in GitHub Desktop.
how to use go:linkname
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
_ "unsafe" | |
_ "github.com/prometheus/prometheus/model/textparse" | |
dto "github.com/prometheus/prometheus/prompb/io/prometheus/client" | |
) | |
//go:linkname isNativeHistogram github.com/prometheus/prometheus/model/textparse.isNativeHistogram | |
func isNativeHistogram(h *dto.Histogram) bool | |
func main() { | |
v := isNativeHistogram(nil) | |
fmt.Println(v) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment