github.com/mvdan/u-root-coreutils@v0.0.0-20230122170626-c2eef2898555/cmds/core/id/id_plan9.go (about) 1 // Copyright 2017-2018 the u-root Authors. All rights reserved 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build plan9 6 // +build plan9 7 8 package main 9 10 import ( 11 "fmt" 12 "log" 13 "os" 14 ) 15 16 func main() { 17 if len(os.Args) != 1 { 18 log.Fatalf("Usage: id") 19 } 20 id, err := os.ReadFile("/env/user") 21 if err != nil { 22 log.Fatal(err) 23 } 24 fmt.Println(string(id)) 25 }