title: "import cycle not allowed" with go install
body: <p>Folks- I'm not able to understand this:</p>
  
  <p>My code layout:</p>
  
  <p>src/rtagent/rtagent.go (has package main)</p>
  
  <p>src/simplerouter/simplerouter.go (has package simplerouter)</p>
  
  <p>src/p4/p4runtime.pb.go (has package p4)</p>
  
  <h2>rtagent.go:</h2>
  
  <pre><code>package main
  import (
      "fmt"
      "golang.org/x/net/context"
      "google.golang.org/grpc"
      "google.golang.org/grpc/reflection"
      "io"
      "log"
      "net"
      "p4"
      "simplerouter"
      p4_config "p4/config"
  )
  </code></pre>
  
  <h2>simplerouter.go</h2>
  
  <pre><code>package simplerouter
  import (
      "encoding/binary"
      "errors"
      "fmt"
      "p4"
      "p4InfoUtils"
      "strings"
      "unsafe"
  )
  </code></pre>
  
  <h2>p4runtime.pb.go</h2>
  
  <pre><code>package p4
  import proto "github.com/golang/protobuf/proto"
  import fmt "fmt"
  import math "math"
  import google_protobuf "github.com/golang/protobuf/ptypes/any"
  import google_rpc "google.golang.org/genproto/googleapis/rpc/status"
  import p4_config "p4/config"
  import p41 "p4"
  import (
      context "golang.org/x/net/context"
      grpc "google.golang.org/grpc"
  )
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>go install rtagent
  import cycle not allowed
  package rtagent
          imports p4
          imports p4
  </code></pre>
  
  <p>Could someone please help?</p>