Add const for all attribute flags and add missing newline

This commit is contained in:
Paul van Santen 2019-12-27 10:56:42 +01:00
parent 1bb2f2849b
commit f94839fd59
No known key found for this signature in database
GPG Key ID: AD10F40CB69516B6
2 changed files with 6 additions and 5 deletions

View File

@ -15,6 +15,9 @@ const (
sshFileXferAttrPermissions = 0x00000004 sshFileXferAttrPermissions = 0x00000004
sshFileXferAttrACmodTime = 0x00000008 sshFileXferAttrACmodTime = 0x00000008
sshFileXferAttrExtented = 0x80000000 sshFileXferAttrExtented = 0x80000000
sshFileXferAttrAll = sshFileXferAttrSize|sshFileXferAttrUIDGID|sshFileXferAttrPermissions|
sshFileXferAttrACmodTime|sshFileXferAttrExtented
) )
// fileInfo is an artificial type designed to satisfy os.FileInfo. // fileInfo is an artificial type designed to satisfy os.FileInfo.

View File

@ -1,12 +1,10 @@
package sftp package sftp
import ( import (
"math"
"os" "os"
"testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"testing"
) )
func TestRequestPflags(t *testing.T) { func TestRequestPflags(t *testing.T) {
@ -52,7 +50,7 @@ func TestRequestAttributes(t *testing.T) {
} }
func TestRequestAttributesEmpty(t *testing.T) { func TestRequestAttributesEmpty(t *testing.T) {
fs, b := getFileStat(math.MaxUint32, nil) fs, b := getFileStat(sshFileXferAttrAll, nil)
assert.Equal(t, &FileStat{ assert.Equal(t, &FileStat{
Extended: []StatExtended{}, Extended: []StatExtended{},
}, fs) }, fs)