Skip to content

Commit 0c7f7a8

Browse files
authored
run gofmt with go1.19 release candidate (#282)
1 parent ca3835e commit 0c7f7a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+119
-90
lines changed

aetest/instance_classic.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build appengine
12
// +build appengine
23

34
package aetest
@@ -13,7 +14,7 @@ func NewInstance(opts *Options) (Instance, error) {
1314
var aeOpts *aetest.Options
1415
if opts != nil {
1516
aeOpts = &aetest.Options{
16-
AppID: opts.AppID,
17+
AppID: opts.AppID,
1718
StronglyConsistentDatastore: opts.StronglyConsistentDatastore,
1819
}
1920
}

aetest/instance_vm.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !appengine
12
// +build !appengine
23

34
package aetest

appengine.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ import (
3535
//
3636
// Main is designed so that the app's main package looks like this:
3737
//
38-
// package main
38+
//package main
3939
//
40-
// import (
41-
// "google.golang.org/appengine"
40+
//import (
41+
// "google.golang.org/appengine"
4242
//
43-
// _ "myapp/package0"
44-
// _ "myapp/package1"
45-
// )
43+
// _ "myapp/package0"
44+
// _ "myapp/package1"
45+
//)
4646
//
47-
// func main() {
48-
// appengine.Main()
49-
// }
47+
//func main() {
48+
// appengine.Main()
49+
//}
5050
//
5151
// The "myapp/packageX" packages are expected to register HTTP handlers
5252
// in their init functions.

appengine_vm.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by the Apache 2.0
33
// license that can be found in the LICENSE file.
44

5+
//go:build !appengine
56
// +build !appengine
67

78
package appengine

capability/capability.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ for specific API capabilities.
99
This package does not work in App Engine "flexible environment".
1010
1111
Example:
12+
1213
if !capability.Enabled(c, "datastore_v3", "write") {
1314
// show user a different page
1415
}

cloudsql/cloudsql.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ with protocol "cloudsql" and an address of the Cloud SQL instance.
1414
1515
A Go MySQL driver that has been tested to work well with Cloud SQL
1616
is the go-sql-driver:
17+
1718
import "database/sql"
1819
import _ "github.com/go-sql-driver/mysql"
1920
2021
db, err := sql.Open("mysql", "user@cloudsql(project-id:instance-name)/dbname")
2122
22-
2323
Another driver that works well with Cloud SQL is the mymysql driver:
24+
2425
import "database/sql"
2526
import _ "github.com/ziutek/mymysql/godrv"
2627
2728
db, err := sql.Open("mymysql", "cloudsql:instance-name*dbname/user/password")
2829
29-
3030
Using either of these drivers, you can perform a standard SQL query.
3131
This example assumes there is a table named 'users' with
3232
columns 'first_name' and 'last_name':

cloudsql/cloudsql_classic.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by the Apache 2.0
33
// license that can be found in the LICENSE file.
44

5+
//go:build appengine
56
// +build appengine
67

78
package cloudsql

cloudsql/cloudsql_vm.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by the Apache 2.0
33
// license that can be found in the LICENSE file.
44

5+
//go:build !appengine
56
// +build !appengine
67

78
package cloudsql

cmd/aebundler/aebundler.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
// A main func is synthesized if one does not exist.
99
//
1010
// A sample Dockerfile to be used with this bundler could look like this:
11-
// FROM gcr.io/google-appengine/go-compat
12-
// ADD . /app
13-
// RUN GOPATH=/app/_gopath go build -tags appenginevm -o /app/_ah/exe
11+
//
12+
// FROM gcr.io/google-appengine/go-compat
13+
// ADD . /app
14+
// RUN GOPATH=/app/_gopath go build -tags appenginevm -o /app/_ah/exe
1415
package main
1516

1617
import (

datastore/doc.go

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
/*
66
Package datastore provides a client for App Engine's datastore service.
77
8-
9-
Basic Operations
8+
# Basic Operations
109
1110
Entities are the unit of storage and are associated with a key. A key
1211
consists of an optional parent key, a string application ID, a string kind
@@ -74,8 +73,7 @@ GetMulti, PutMulti and DeleteMulti are batch versions of the Get, Put and
7473
Delete functions. They take a []*Key instead of a *Key, and may return an
7574
appengine.MultiError when encountering partial failure.
7675
77-
78-
Properties
76+
# Properties
7977
8078
An entity's contents can be represented by a variety of types. These are
8179
typically struct pointers, but can also be any type that implements the
@@ -137,8 +135,7 @@ Example code:
137135
J int `datastore:",noindex" json:"j"`
138136
}
139137
140-
141-
Structured Properties
138+
# Structured Properties
142139
143140
If the struct pointed to contains other structs, then the nested or embedded
144141
structs are flattened. For example, given these definitions:
@@ -179,8 +176,7 @@ equivalent field would instead be: FooDotZ bool `datastore:"Foo.Z"`.
179176
If an outer struct is tagged "noindex" then all of its implicit flattened
180177
fields are effectively "noindex".
181178
182-
183-
The PropertyLoadSaver Interface
179+
# The PropertyLoadSaver Interface
184180
185181
An entity's contents can also be represented by any type that implements the
186182
PropertyLoadSaver interface. This type may be a struct pointer, but it does
@@ -230,8 +226,7 @@ Example code:
230226
The *PropertyList type implements PropertyLoadSaver, and can therefore hold an
231227
arbitrary entity's contents.
232228
233-
234-
Queries
229+
# Queries
235230
236231
Queries retrieve entities based on their properties or key's ancestry. Running
237232
a query yields an iterator of results: either keys or (key, entity) pairs.
@@ -284,8 +279,7 @@ Example code:
284279
io.Copy(w, b)
285280
}
286281
287-
288-
Transactions
282+
# Transactions
289283
290284
RunInTransaction runs a function in a transaction.
291285
@@ -323,8 +317,7 @@ Example code:
323317
fmt.Fprintf(w, "Count=%d", count)
324318
}
325319
326-
327-
Metadata
320+
# Metadata
328321
329322
The datastore package provides access to some of App Engine's datastore
330323
metadata. This metadata includes information about the entity groups,

0 commit comments

Comments
 (0)