code: func RegisterDetail(label string, key interface{}) {
  	detailsLock.Lock()
  	defer detailsLock.Unlock()
  
  	if detailFields == nil {
  		detailFields = map[string]interface{}{}
  	}
  	detailFields[label] = key
  }
docs: // RegisterDetail registers an error property key in a global registry, with a label.
  // The registry is used by the Details() function.  Registered error properties will
  // be included in Details() output, if the value of that error property is not nil.
  // For example:
  //
  //     err := New("boom")
  //     err = err.WithValue(colorKey, "red")
  //     fmt.Println(Details(err))
  //
  //     // Output:
  //     // boom
  //     //
  //     // <stacktrace>
  //
  //     RegisterDetail("Color", colorKey)
  //     fmt.Println(Details(err))
  //
  //     // Output:
  //     // boom
  //     // Color: red
  //     //
  //     // <stacktrace>
  //
  // Error property keys are typically not exported by the packages which define them.
  // Packages instead export functions which let callers access that property.
  // It's therefore up to the package
  // to register those properties which would make sense to include in the Details() output.
  // In other words, it's up to the author of the package which generates the errors
  // to publish printable error details, not the callers of the package.