package main

import (
	"log"
	"os/exec"
)

func lastlog() (string, error) {
	users, err := exec.Command("/usr/bin/lastlog", "--time", "365").Output()
	if err != nil {
		log.Fatal(err)
	}
	return string(users), nil
}

package main

import (
	"log"
	"os/exec"
)

func lastlog() (string, error) {
	users := exec.Command("/usr/bin/lastlog", "--time", "365")
	awk := exec.Command("/usr/bin/awk", `{print $1","$3","$4" "$5" "$6" "$7" "$8}`)

	out, err := users.StdoutPipe()
	if err != nil {
		log.Fatal(err)
	}
	users.Start()
	awk.Stdin = out

	users_out, err := awk.Output()
	if err != nil {
		log.Fatal(err)
	}

	return string(users_out), nil
}

Format command using awk (incomplete)
Format command using awk (incomplete)
