*os.File, err error) { 2 if c.Stdin == nil { 3 f, err = os.Open(os.DevNull) 4 if err != nil { 5 return 6 } 7 c.closeAfterStart = append(c.closeAfterStart, f) 8 return 9 } 10 11 if f, ok := c.Stdin.(*os.File); ok { 12 return f, nil 13 } 14 15 pr, pw, err := os.Pipe() 16 if err != nil { 17 return 18 } /dev/nullΛopenͯ͠ඪ४ೖྗ ʹׂΓ͍ͯͯΔʂ ͋ΕʁͰ/dev/null writeγεςϜίʔϧͰ ॻ͖ࠐΊΔͣ ౾ࣝ: goฦΓʹ໊લΛ͚ͭΔ ͜ͱ͕Ͱ͖, return͢ΔͱσϑΥϧ τͰͦͷ໊લͷมΛฦ͢