Debian Codegraph @

slave/slave.go

raw symbols SCIP
1 // Copyright 2011 The Go 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 package slave
6
7 import (
8 "fmt"
9 "log"
10 "net"
11 "net/http"
12 "os"
13 )
14
15 func Main() {
16 if len(os.Args) != 2 || os.Args[1] != "LISTEN_STDIN" {
17 fmt.Fprintf(os.Stderr, "devweb slave must be invoked by devweb\n")
18 os.Exit(2)
19 }
20 l, err := net.FileListener(os.Stdin)
21 if err != nil {
22 log.Fatal(err)
23 }
24 os.Stdin.Close()
25 log.Fatal(http.Serve(l, nil))
26 }