Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create a unique directory using the hostname and date information.
- package main
- import (
- "log"
- "os"
- "time"
- )
- func main() {
- name, err := os.Hostname()
- if err != nil {
- log.Printf("Failed to get the hostname")
- }
- t := time.Now()
- name += t.Format("_20060102-030405")
- os.Mkdir(name, os.FileMode(777))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement