fix lint errors
Some checks failed
Declarative Tests / test (push) Waiting to run
Declarative Tests / build-fedora (push) Waiting to run
Declarative Tests / build-ubuntu-focal (push) Waiting to run
Lint / golangci-lint (push) Has been cancelled

This commit is contained in:
Matthew Rich 2024-09-27 02:13:01 +00:00
parent 2fd1764cce
commit 27ab3711a6
4 changed files with 13 additions and 7 deletions

View File

@ -98,14 +98,20 @@ func (a *App) SetOutput(uri string) (err error) {
// Each document has an `imports` keyword which can be used to load dependencies // Each document has an `imports` keyword which can be used to load dependencies
func (a *App) LoadDocumentImports() error { func (a *App) LoadDocumentImports() error {
for _, d := range a.Documents { for i, d := range a.Documents {
for _, importedDocument := range d.ImportedDocuments() { importedDocs := d.ImportedDocuments()
for _, importedDocument := range importedDocs {
docURI := folio.URI(importedDocument.GetURI()) docURI := folio.URI(importedDocument.GetURI())
if _, ok := a.ImportedMap[docURI]; !ok { if _, ok := a.ImportedMap[docURI]; !ok {
a.ImportedMap[docURI] = importedDocument a.ImportedMap[docURI] = importedDocument
a.Documents = append(a.Documents, nil)
copy(a.Documents[i+1:], a.Documents[i:])
a.Documents[i] = importedDocument
/*
if _, outputErr := a.emitter.Emit(importedDocument, nil); outputErr != nil { if _, outputErr := a.emitter.Emit(importedDocument, nil); outputErr != nil {
return outputErr return outputErr
} }
*/
} }
} }
} }

View File

@ -173,7 +173,7 @@ func TestCreateContainerImagePush(t *testing.T) {
} }
func TestContainerImageContextDocument(t *testing.T) { func TestContainerImageContextDocument(t *testing.T) {
contextDir, _ := filepath.Abs(filepath.Join(TempDir, "context")) contextDir, _ := filepath.Abs(TempDir.FilePath("context"))
etcDir, _ := filepath.Abs(filepath.Join(contextDir, "etc")) etcDir, _ := filepath.Abs(filepath.Join(contextDir, "etc"))
binDir, _ := filepath.Abs(filepath.Join(contextDir, "bin")) binDir, _ := filepath.Abs(filepath.Join(contextDir, "bin"))

View File

@ -127,9 +127,9 @@ func TestPKIEncodeKeys(t *testing.T) {
} }
func TestPKIResource(t *testing.T) { func TestPKIResource(t *testing.T) {
privateKeyFile, _ := filepath.Abs(filepath.Join(TempDir, "fooprivatekey.pem")) privateKeyFile, _ := filepath.Abs(TempDir.FilePath("fooprivatekey.pem"))
publicKeyFile, _ := filepath.Abs(filepath.Join(TempDir, "foopublickey.pem")) publicKeyFile, _ := filepath.Abs(TempDir.FilePath("foopublickey.pem"))
certFile, _ := filepath.Abs(filepath.Join(TempDir, "foocert.pem")) certFile, _ := filepath.Abs(TempDir.FilePath("foocert.pem"))
var resourceYaml, readResourceYaml strings.Builder var resourceYaml, readResourceYaml strings.Builder
expected := fmt.Sprintf(` expected := fmt.Sprintf(`

View File

@ -31,7 +31,7 @@ func TestSchemaValidateJSON(t *testing.T) {
s := NewSchema("file") s := NewSchema("file")
assert.NotEqual(t, nil, s) assert.NotEqual(t, nil, s)
file, _ := filepath.Abs(filepath.Join(TempDir, "fooread.txt")) file, _ := filepath.Abs(TempDir.FilePath("fooread.txt"))
expectedAtime, atimeErr := time.Parse(time.RFC3339Nano, "2001-12-15T01:01:01.000000001Z") expectedAtime, atimeErr := time.Parse(time.RFC3339Nano, "2001-12-15T01:01:01.000000001Z")
assert.Nil(t, atimeErr) assert.Nil(t, atimeErr)