gitlab.com/gitlab-org/labkit@v1.21.0/errortracking/capture_user.go (about)

     1  package errortracking
     2  
     3  import (
     4  	"github.com/getsentry/sentry-go"
     5  )
     6  
     7  // WithUserID allows to add a user id to the error.
     8  func WithUserID(userID string) CaptureOption {
     9  	return func(config *captureConfig, event *sentry.Event) {
    10  		event.User.ID = userID
    11  	}
    12  }