mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 18:13:42 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			411 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			411 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package tracing
 | 
						|
 | 
						|
import (
 | 
						|
	"go.opentelemetry.io/otel/trace"
 | 
						|
)
 | 
						|
 | 
						|
// MultiSpan allows shared tracing to multiple spans.
 | 
						|
// TODO: This is a temporary solution and doesn't really support shared tracing yet. Instead the first always wins.
 | 
						|
 | 
						|
type MultiSpan struct {
 | 
						|
	trace.Span
 | 
						|
}
 | 
						|
 | 
						|
func NewMultiSpan() *MultiSpan {
 | 
						|
	return &MultiSpan{}
 | 
						|
}
 | 
						|
 | 
						|
func (ms *MultiSpan) Add(s trace.Span) {
 | 
						|
	if ms.Span == nil {
 | 
						|
		ms.Span = s
 | 
						|
	}
 | 
						|
}
 |