diff --git a/lib/protocol/nativemodel_darwin.go b/lib/protocol/nativemodel_darwin.go index b08c8fac3..ef5d15b35 100644 --- a/lib/protocol/nativemodel_darwin.go +++ b/lib/protocol/nativemodel_darwin.go @@ -9,6 +9,8 @@ package protocol import "golang.org/x/text/unicode/norm" +func makeNative(m Model) Model { return nativeModel{m} } + type nativeModel struct { Model } diff --git a/lib/protocol/nativemodel_unix.go b/lib/protocol/nativemodel_unix.go index 9aa094491..90e50e394 100644 --- a/lib/protocol/nativemodel_unix.go +++ b/lib/protocol/nativemodel_unix.go @@ -7,6 +7,4 @@ package protocol // Normal Unixes uses NFC and slashes, which is the wire format. -type nativeModel struct { - Model -} +func makeNative(m Model) Model { return m } diff --git a/lib/protocol/nativemodel_windows.go b/lib/protocol/nativemodel_windows.go index da91c7949..c6e8bf124 100644 --- a/lib/protocol/nativemodel_windows.go +++ b/lib/protocol/nativemodel_windows.go @@ -13,6 +13,8 @@ import ( "strings" ) +func makeNative(m Model) Model { return nativeModel{m} } + type nativeModel struct { Model } diff --git a/lib/protocol/protocol.go b/lib/protocol/protocol.go index 410c8bd72..a7f9408a0 100644 --- a/lib/protocol/protocol.go +++ b/lib/protocol/protocol.go @@ -231,7 +231,7 @@ var CloseTimeout = 10 * time.Second func NewConnection(deviceID DeviceID, reader io.Reader, writer io.Writer, closer io.Closer, receiver Model, connInfo ConnectionInfo, compress Compression, passwords map[string]string) Connection { // Encryption / decryption is first (outermost) before conversion to // native path formats. - nm := nativeModel{receiver} + nm := makeNative(receiver) em := &encryptedModel{model: nm, folderKeys: newFolderKeyRegistry(passwords)} // We do the wire format conversion first (outermost) so that the