Skip to content

Commit 2827645

Browse files
authored
Reformat existing Go code, add build tags (#416)
1 parent 5269e7e commit 2827645

27 files changed

+46
-28
lines changed

_examples/cloudfunction/function_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type MockTransport struct{}
3636
// RoundTrip returns a mock response.
3737
func (t *MockTransport) RoundTrip(req *http.Request) (*http.Response, error) {
3838
return &http.Response{
39-
Body: ioutil.NopCloser(strings.NewReader(`{"status":"mocked"}`)),
39+
Body: ioutil.NopCloser(strings.NewReader(`{"status":"mocked"}`)),
4040
Header: http.Header{"X-Elastic-Product": []string{"Elasticsearch"}},
4141
}, nil
4242
}

_examples/extension/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
//go:build ignore
1819
// +build ignore
1920

2021
// This examples demonstrates how extend the API of the client by embedding it inside a custom type.
@@ -30,9 +31,9 @@ import (
3031
"net/url"
3132
"os"
3233

34+
"github.com/elastic/elastic-transport-go/v8/elastictransport"
3335
"github.com/elastic/go-elasticsearch/v8"
3436
"github.com/elastic/go-elasticsearch/v8/esapi"
35-
"github.com/elastic/elastic-transport-go/v8/elastictransport"
3637
)
3738

3839
const port = "9209"

_examples/instrumentation/expvar.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ import (
3636

3737
"golang.org/x/crypto/ssh/terminal"
3838

39-
"github.com/elastic/go-elasticsearch/v8"
4039
"github.com/elastic/elastic-transport-go/v8/elastictransport"
40+
"github.com/elastic/go-elasticsearch/v8"
4141
)
4242

4343
var (

_examples/logging/custom.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
//go:build ignore
1819
// +build ignore
1920

2021
// This examples demonstrates how to implement the "elastictransport.Logger" interface with a custom type,

_examples/logging/default.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
//go:build ignore
1819
// +build ignore
1920

2021
// This collection of examples demonstrates how to configure the default logger of the client.
@@ -31,8 +32,8 @@ import (
3132
"os"
3233
"strings"
3334

34-
"github.com/elastic/go-elasticsearch/v8"
3535
"github.com/elastic/elastic-transport-go/v8/elastictransport"
36+
"github.com/elastic/go-elasticsearch/v8"
3637
)
3738

3839
func main() {

_examples/security/tls_configure_ca.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
//go:build ignore
1819
// +build ignore
1920

2021
package main

_examples/security/tls_with_ca.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
//go:build ignore
1819
// +build ignore
1920

2021
package main

_examples/xkcdsearch/store_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func TestStore(t *testing.T) {
8181
Response: &http.Response{
8282
StatusCode: http.StatusOK,
8383
Body: ioutil.NopCloser(strings.NewReader(`{}`)),
84-
Header: http.Header{"X-Elastic-Product": []string{"Elasticsearch"}},
84+
Header: http.Header{"X-Elastic-Product": []string{"Elasticsearch"}},
8585
},
8686
}
8787
mocktrans.RoundTripFn = func(req *http.Request) (*http.Response, error) { return mocktrans.Response, nil }

elasticsearch_benchmark_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
//go:build !integration
1819
// +build !integration
1920

2021
package elasticsearch_test

elasticsearch_example_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
//go:build !integration
1819
// +build !integration
1920

2021
package elasticsearch_test

0 commit comments

Comments
 (0)