forgejo/modules/log/groutinelabel.go
Gusted 61e21d7ded
chore: Make Forgejo build with go1.24
- [Go 1.24](https://groups.google.com/g/golang-announce/c/vYMfuq_XO6w)
is currently out for rc1.
- Using it to test unit tests and integration testing it failed horribly
with strange panics and errors, it is caused by
ca63101df4
and Forgejo trying to access the wrong internal data structures that
have been changed in Go 1.24.
- Use the new data structure for Go 1.24 and above.
2024-12-17 16:12:22 +01:00

21 lines
429 B
Go

//go:build !go1.24
// Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package log
import "unsafe"
//go:linkname runtime_getProfLabel runtime/pprof.runtime_getProfLabel
func runtime_getProfLabel() unsafe.Pointer //nolint
type labelMap map[string]string
func getGoroutineLabels() map[string]string {
l := (*labelMap)(runtime_getProfLabel())
if l == nil {
return nil
}
return *l
}