Help us shape the future of Go! Take the 2026 Go Developer Survey

copy

package module
v0.0.0-...-9359aef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2019 License: MIT Imports: 4 Imported by: 0

README

copy

Build Status codecov GoDoc Go Report Card

copy copies directories recursively.

Example:

err := Copy("your/directory", "your/directory.copy")

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(src, dest string) error

Copy copies src to dest, doesn't matter if src is a directory or a file

Example
err := Copy("testdata/example", "testdata.copy/example")
fmt.Println("Error:", err)
info, _ := os.Stat("testdata.copy/example")
fmt.Println("IsDir:", info.IsDir())
Output:
Error: <nil>
IsDir: true

func Perm

func Perm(src, dest string, dirPerm, filePerm os.FileMode) error

Perm copies src to dest, doesn't matter if src is a directory of a file. All directories permissions will be set to destPerm. All file permissions will be set to filePerm.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL