cmd/coordinator/spanlog: remove spanlog package

This removes the spanlog package located inside the
coordinator package. The spanlog package has already been
copied over to the internal package. All imports in the build
repository have been changes to point to the internal spanlog
package.

Updates golang/go#36841

Change-Id: I84499bcfe782c566b12dabcbfa743cd8ce559f18
Reviewed-on: https://go-review.googlesource.com/c/build/+/227023
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/cmd/coordinator/coordinator.go b/cmd/coordinator/coordinator.go
index 6a719a5..357f36a 100644
--- a/cmd/coordinator/coordinator.go
+++ b/cmd/coordinator/coordinator.go
@@ -56,7 +56,6 @@
 	"golang.org/x/build/autocertcache"
 	"golang.org/x/build/buildenv"
 	"golang.org/x/build/buildlet"
-	"golang.org/x/build/cmd/coordinator/spanlog"
 	"golang.org/x/build/dashboard"
 	"golang.org/x/build/gerrit"
 	"golang.org/x/build/internal/buildgo"
@@ -64,6 +63,7 @@
 	"golang.org/x/build/internal/secret"
 	"golang.org/x/build/internal/singleflight"
 	"golang.org/x/build/internal/sourcecache"
+	"golang.org/x/build/internal/spanlog"
 	"golang.org/x/build/livelog"
 	"golang.org/x/build/maintner/maintnerd/apipb"
 	"golang.org/x/build/repos"
diff --git a/cmd/coordinator/gce.go b/cmd/coordinator/gce.go
index 03592e5..762a4b5 100644
--- a/cmd/coordinator/gce.go
+++ b/cmd/coordinator/gce.go
@@ -34,13 +34,13 @@
 	"cloud.google.com/go/storage"
 	"golang.org/x/build/buildenv"
 	"golang.org/x/build/buildlet"
-	"golang.org/x/build/cmd/coordinator/spanlog"
 	"golang.org/x/build/dashboard"
 	"golang.org/x/build/gerrit"
 	"golang.org/x/build/internal/buildgo"
 	"golang.org/x/build/internal/buildstats"
 	"golang.org/x/build/internal/lru"
 	"golang.org/x/build/internal/secret"
+	"golang.org/x/build/internal/spanlog"
 	"golang.org/x/oauth2"
 	"golang.org/x/oauth2/google"
 	"google.golang.org/api/compute/v1"
diff --git a/cmd/coordinator/sched.go b/cmd/coordinator/sched.go
index 314f891..64e8d38 100644
--- a/cmd/coordinator/sched.go
+++ b/cmd/coordinator/sched.go
@@ -16,9 +16,9 @@
 	"time"
 
 	"golang.org/x/build/buildlet"
-	"golang.org/x/build/cmd/coordinator/spanlog"
 	"golang.org/x/build/dashboard"
 	"golang.org/x/build/internal/buildgo"
+	"golang.org/x/build/internal/spanlog"
 	"golang.org/x/build/types"
 )
 
diff --git a/cmd/coordinator/sched_test.go b/cmd/coordinator/sched_test.go
index 2636069..67ba1df 100644
--- a/cmd/coordinator/sched_test.go
+++ b/cmd/coordinator/sched_test.go
@@ -15,8 +15,8 @@
 	"time"
 
 	"golang.org/x/build/buildlet"
-	"golang.org/x/build/cmd/coordinator/spanlog"
 	"golang.org/x/build/dashboard"
+	"golang.org/x/build/internal/spanlog"
 )
 
 func TestSchedLess(t *testing.T) {
diff --git a/cmd/coordinator/spanlog/README.md b/cmd/coordinator/spanlog/README.md
deleted file mode 100644
index 80512c8..0000000
--- a/cmd/coordinator/spanlog/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- Auto-generated by x/build/update-readmes.go -->
-
-[![GoDoc](https://godoc.org/golang.org/x/build/cmd/coordinator/spanlog?status.svg)](https://godoc.org/golang.org/x/build/cmd/coordinator/spanlog)
-
-# golang.org/x/build/cmd/coordinator/spanlog
-
-Package spanlog provides span and event logger interfaces that are used by the build coordinator infrastructure.
diff --git a/cmd/coordinator/spanlog/spanlog.go b/cmd/coordinator/spanlog/spanlog.go
deleted file mode 100644
index bcf7b3a..0000000
--- a/cmd/coordinator/spanlog/spanlog.go
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package spanlog provides span and event logger interfaces that are used
-// by the build coordinator infrastructure.
-package spanlog
-
-// SpanLogger is something that has the CreateSpan method, which
-// creates a event spanning some duration which will eventually be
-// logged and visualized.
-type Logger interface {
-	// CreateSpan logs the start of an event.
-	// optText is 0 or 1 strings.
-	CreateSpan(event string, optText ...string) Span
-}
-
-// Span is a handle that can eventually be closed.
-// Typical usage:
-//
-//   sp := sl.CreateSpan("slow_operation")
-//   result, err := doSlowOperation()
-//   sp.Done(err)
-//   // do something with result, err
-type Span interface {
-	// Done marks a span as done.
-	// The err is returned unmodified for convenience at callsites.
-	Done(err error) error
-}
-
-// TODO(quentin): Move loggerFunc and createSpan from coordinator.go to here.
diff --git a/internal/buildgo/benchmarks.go b/internal/buildgo/benchmarks.go
index a14453e..ed25472 100644
--- a/internal/buildgo/benchmarks.go
+++ b/internal/buildgo/benchmarks.go
@@ -15,9 +15,9 @@
 
 	"golang.org/x/build/buildenv"
 	"golang.org/x/build/buildlet"
-	"golang.org/x/build/cmd/coordinator/spanlog"
 	"golang.org/x/build/dashboard"
 	"golang.org/x/build/internal/sourcecache"
+	"golang.org/x/build/internal/spanlog"
 )
 
 // benchRuns is the number of times to run each benchmark binary
diff --git a/internal/buildgo/buildgo.go b/internal/buildgo/buildgo.go
index 35c89df..3862085 100644
--- a/internal/buildgo/buildgo.go
+++ b/internal/buildgo/buildgo.go
@@ -20,9 +20,9 @@
 
 	"golang.org/x/build/buildenv"
 	"golang.org/x/build/buildlet"
-	"golang.org/x/build/cmd/coordinator/spanlog"
 	"golang.org/x/build/dashboard"
 	"golang.org/x/build/internal/sourcecache"
+	"golang.org/x/build/internal/spanlog"
 )
 
 // BuilderRev is a build configuration type and a revision.
diff --git a/internal/sourcecache/source.go b/internal/sourcecache/source.go
index 6c79183..933cd8a 100644
--- a/internal/sourcecache/source.go
+++ b/internal/sourcecache/source.go
@@ -19,9 +19,9 @@
 	"net/http"
 	"time"
 
-	"golang.org/x/build/cmd/coordinator/spanlog"
 	"golang.org/x/build/internal/lru"
 	"golang.org/x/build/internal/singleflight"
+	"golang.org/x/build/internal/spanlog"
 )
 
 var processStartTime = time.Now()