mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 08:46:55 +08:00
1 parent
3f797e656b
commit
91e5b57e24
43 files changed
+2018
-384
No files matched your search
@@ -74,7 +74,7 @@ func (e *Editor) compactResourceReferences(parts map[string][]byte, reader *Read
|
||||
ctx = e.output.ctx
|
||||
}
|
||||
progress = progress.withContext(ctx)
|
||||
scope, err := reader.versionResourceFiles(ctx, parts, generated)
|
||||
_, scope, err := reader.versionResourceFiles(ctx, parts, generated)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -351,16 +351,16 @@ func (r *editorResourceRefs) reference(name, base, key, value string, resource b
|
||||
if kind == editorReferenceNone {
|
||||
return
|
||||
}
|
||||
value = strings.TrimSpace(value)
|
||||
if value == "" {
|
||||
return
|
||||
}
|
||||
if kind == editorReferenceID {
|
||||
if id := editorResourceID(value); id != "" {
|
||||
r.ids[id] = true
|
||||
}
|
||||
return
|
||||
}
|
||||
value = strings.TrimSpace(value)
|
||||
if value == "" {
|
||||
return
|
||||
}
|
||||
r.files[editorResourceLocation(name, base, value)] = true
|
||||
r.files[cleanPackagePath(resolveResourcePath(name, base, value))] = true
|
||||
}
|
||||
@@ -389,7 +389,7 @@ func editorResourceReferenceKind(key string, resource bool) int {
|
||||
// 入参: value 标识文本
|
||||
// 返回: string 标准十进制标识,无效时为空
|
||||
func editorResourceID(value string) string {
|
||||
id, err := strconv.ParseUint(strings.TrimSpace(value), 10, 32)
|
||||
id, err := strconv.ParseUint(strings.Trim(value, " \t\r\n"), 10, 32)
|
||||
if err != nil || id == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user