How to create hardlinks recursively?

Viewed 26

If I were to do it on Linux alone, it'd be easy with the following code:

package main

import (
    "fmt"
    "log"
    "os/exec"
)

func main() {

    err := exec.Command("cp", "-rl", "src/path", "target/path").Run()
    if err != nil {
        log.Fatal(err)
    }
}

However, I am looking for a way to do so in Golang so that it works across different operating systems.

0 Answers
Related