gofmt
This commit is contained in:
parent
2f38af12a2
commit
86cbbcb8bd
|
@ -140,20 +140,20 @@ func ClaspDirectives(text string, entities []*client.TextEntity) []*client.TextE
|
|||
endOffset := entity.Offset + entity.Length
|
||||
|
||||
if unicode.IsSpace(doubledRunes[entity.Offset]) {
|
||||
for j, r := range doubledRunes[entity.Offset+1:endOffset] {
|
||||
for j, r := range doubledRunes[entity.Offset+1 : endOffset] {
|
||||
if !unicode.IsSpace(r) {
|
||||
dirty = true
|
||||
entity.Offset += int32(j+1)
|
||||
entity.Length -= int32(j+1)
|
||||
entity.Offset += int32(j + 1)
|
||||
entity.Length -= int32(j + 1)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if unicode.IsSpace(doubledRunes[endOffset-1]) {
|
||||
for j := endOffset-2; j >= entity.Offset; j-- {
|
||||
for j := endOffset - 2; j >= entity.Offset; j-- {
|
||||
if !unicode.IsSpace(doubledRunes[j]) {
|
||||
dirty = true
|
||||
entity.Length = j+1-entity.Offset
|
||||
entity.Length = j + 1 - entity.Offset
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
|
@ -375,12 +375,12 @@ func (c *Client) formatFile(file *client.File, compact bool) string {
|
|||
return ""
|
||||
}
|
||||
|
||||
size64:= uint64(file.Size)
|
||||
size64 := uint64(file.Size)
|
||||
c.prepareDiskSpace(size64)
|
||||
|
||||
basename := file.Remote.UniqueId + filepath.Ext(src)
|
||||
dest := c.content.Path + "/" + basename // destination path
|
||||
link = c.content.Link + "/" + basename // download link
|
||||
link = c.content.Link + "/" + basename // download link
|
||||
|
||||
// move
|
||||
err = os.Rename(src, dest)
|
||||
|
|
|
@ -23,16 +23,17 @@ var db *persistence.SessionsYamlDB
|
|||
var sessionLock sync.Mutex
|
||||
|
||||
const (
|
||||
B uint64 = 1
|
||||
KB = B << 10
|
||||
MB = KB << 10
|
||||
GB = MB << 10
|
||||
TB = GB << 10
|
||||
PB = TB << 10
|
||||
EB = PB << 10
|
||||
B uint64 = 1
|
||||
KB = B << 10
|
||||
MB = KB << 10
|
||||
GB = MB << 10
|
||||
TB = GB << 10
|
||||
PB = TB << 10
|
||||
EB = PB << 10
|
||||
|
||||
maxUint64 uint64 = (1 << 64) - 1
|
||||
)
|
||||
|
||||
var sizeRegex = regexp.MustCompile("\\A([0-9]+) ?([KMGTPE]?B?)\\z")
|
||||
|
||||
// NewComponent starts a new component and wraps it in
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
|
||||
// StorageQuota is a value from config parsed to bytes number
|
||||
var StorageQuota uint64
|
||||
|
||||
// CachedStorageSize estimates the storage size between full rescans
|
||||
var CachedStorageSize uint64
|
||||
var StorageLock = sync.Mutex{}
|
||||
|
|
Loading…
Reference in a new issue