// ATM, we require to one and only one trezor device to be connected.
// The support of multiple trezor devices is not implemented, yet.
iflen(trezors)==0{
tlog.Fatal.Printf("Trezor device is not found. Check the connection.")
os.Exit(exitcodes.TrezorError)
}
iflen(trezors)>1{
tlog.Fatal.Printf("It's more than one Trezor device connected. This case is not implemented, yet. The number of currently connected devices: %v.",len(trezors))
os.Exit(exitcodes.TrezorError)
}
// Using the first found device
trezor:=trezors[0]
// Trezor may ask for PIN or Passphrase. Setting the handler for this case.
trezor.SetGetPinFunc(trezorGetPin)
// In some cases (like lost connection to the Trezor device and cannot
// reconnect) it's required to get a confirmation from the user to
// retry to reconnect. Setting the handler for this case.
trezor.SetGetConfirmFunc(trezorGetConfirm)
// To reset the state of the device and check if it's initialized.
// If device is not initialized then trezor.Reset() will return an