• ericdreeves's avatar
    Add Files action to template context. (closes #1198) (#1226) · 08c17c7c
    ericdreeves authored
    * Add Files action to template context. (#1198)
    
    * Fixes to testFiles().
    
    - Set os.ModePerm on directories created during test.
    - Use filepath.Join() to create directory path.
    - Use Fatalf, not Fatal.
    
    * Make additional fixes to test cases.
    
    * Fix test cases to use correct path format.
    
    Dir.Open() in net/http requires '/'-separated paths while
    filepath.Join() may produce paths with different separator.
    
    * Remove directory created by test at end of loop.
    
    * Close the FileSystem before returning.
    
    * Initialize names slice to the number of entries.
    
    Also, do not call os.RemoveAll() unless the path to the directory
    is a valid one.
    08c17c7c
context_test.go 18.4 KB