code: func writeCallback(index C.int, stream C.int, s *C.char) {
  	handle, err := lookupHandler(int(index))
  	if err != nil {
  		log.Errorf("Unable to write to output stream: %v", err)
  		return
  	}
  
  	// To prevent poorly written PAM modules from sending more data than they
  	// should, cap strings to the maximum message size that PAM allows.
  	str := C.GoStringN(s, C.int(C.strnlen(s, C.PAM_MAX_MSG_SIZE)))
  
  	// Write to the stream (typically stdout or stderr or equivalent).
  	handle.writeStream(int(stream), str)
  }
docs: //export writeCallback