create tests directory format

This commit is contained in:
m
2026-09-02 09:52:26 +02:00
parent 479c8ab61c
commit 32a61e6a64
94 changed files with 95 additions and 6476 deletions
+46
View File
@@ -0,0 +1,46 @@
package main
import "fmt"
type Document struct {
DocumentName string
DocumentType int
}
const (
ERROR_DOCUMENT_TYPE = "ERROR_DOCUMENT_TYPE"
)
const (
FILE = 1
DIRECTORY = 2
)
func IsDocumentTypeValid(documentType int) bool {
return IsFile(documentType) || IsDirectory(documentType)
}
func IsFile(documentType int) bool {
return FILE == documentType
}
func IsDirectory(documentType int) bool {
return DIRECTORY == documentType
}
func NewDocument(documentName string, documentType int) (error, *Document) {
documentTypeIsValid := IsDocumentTypeValid(documentType)
if !documentTypeIsValid {
return fmt.Errorf(ERROR_DOCUMENT_TYPE), nil
}
return nil, &Document{
DocumentName: documentName,
DocumentType: documentType,
}
}