Skip to content

Commit ce6a79c

Browse files
rscgopherbot
authored andcommitted
all: gofmt
Gofmt to update doc comments to the new formatting. For golang/go#51082. Change-Id: I9b4c287e2d25aa108adfa9fe2f972c8fd3d68fe1 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/399597 Run-TryBot: Russ Cox <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Auto-Submit: Russ Cox <[email protected]>
1 parent e579adb commit ce6a79c

File tree

22 files changed

+147
-133
lines changed

22 files changed

+147
-133
lines changed

app/darwin_desktop.go

+1
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ func convRune(r rune) rune {
240240
// into the standard keycodes used by the key package.
241241
//
242242
// To get a sense of the key map, see the diagram on
243+
//
243244
// http://boredzo.org/blog/archives/2007-05-22/virtual-key-codes
244245
func convVirtualKeyCode(vkcode uint16) key.Code {
245246
switch vkcode {

app/doc.go

+10-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ OpenGL, audio, and other Android NDK-like APIs. An all-Go app should
1818
use this app package to initialize the app, manage its lifecycle, and
1919
receive events.
2020
21-
Building apps
21+
# Building apps
2222
2323
Apps written entirely in Go have a main function, and can be built
2424
with `gomobile build`, which directly produces runnable output for
@@ -30,7 +30,7 @@ https://golang.org/x/mobile/cmd/gomobile.
3030
For detailed instructions and documentation, see
3131
https://golang.org/wiki/Mobile.
3232
33-
Event processing in Native Apps
33+
# Event processing in Native Apps
3434
3535
The Go runtime is initialized on Android when NativeActivity onCreate is
3636
called, and on iOS when the process starts. In both cases, Go init functions
@@ -69,17 +69,20 @@ goroutine as other code that calls OpenGL.
6969
An event is represented by the empty interface type interface{}. Any value can
7070
be an event. Commonly used types include Event types defined by the following
7171
packages:
72-
- golang.org/x/mobile/event/lifecycle
73-
- golang.org/x/mobile/event/mouse
74-
- golang.org/x/mobile/event/paint
75-
- golang.org/x/mobile/event/size
76-
- golang.org/x/mobile/event/touch
72+
- golang.org/x/mobile/event/lifecycle
73+
- golang.org/x/mobile/event/mouse
74+
- golang.org/x/mobile/event/paint
75+
- golang.org/x/mobile/event/size
76+
- golang.org/x/mobile/event/touch
77+
7778
For example, touch.Event is the type that represents touch events. Other
7879
packages may define their own events, and send them on an app's event channel.
7980
8081
Other packages can also register event filters, e.g. to manage resources in
8182
response to lifecycle events. Such packages should call:
83+
8284
app.RegisterFilter(etc)
85+
8386
in an init function inside that package.
8487
*/
8588
package app // import "golang.org/x/mobile/app"

app/internal/callfn/callfn.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build android && (arm || 386 || amd64 || arm64)
56
// +build android
67
// +build arm 386 amd64 arm64
78

bind/testdata/testpkg/tagged.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build aaa && bbb
56
// +build aaa,bbb
67

78
// This file tests that tags work with gomobile.

cmd/gobind/doc.go

+20-23
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ generated and automatically packaged for Android or iOS by
1111
`gomobile bind`. For more details on installing and using the gomobile
1212
tool, see https://golang.org/x/mobile/cmd/gomobile.
1313
14-
Binding Go
14+
# Binding Go
1515
1616
Gobind generates target language (Java or Objective-C) bindings for
1717
each exported symbol in a Go package. The Go package you choose to
@@ -24,7 +24,7 @@ package can then be _ imported into a Go program, typically built
2424
with -buildmode=c-archive for iOS or -buildmode=c-shared for Android.
2525
These details are handled by the `gomobile bind` command.
2626
27-
Passing Go objects to target languages
27+
# Passing Go objects to target languages
2828
2929
Consider a type for counting:
3030
@@ -85,7 +85,7 @@ The equivalent of calling newCounter in Go is GoMypkgNewCounter in Objective-C.
8585
The returned GoMypkgCounter* holds a reference to an underlying Go
8686
*Counter.
8787
88-
Passing target language objects to Go
88+
# Passing target language objects to Go
8989
9090
For a Go interface:
9191
@@ -125,7 +125,6 @@ The Java implementation can be used like so:
125125
Printer printer = new SysPrint();
126126
Myfmt.printHello(printer);
127127
128-
129128
For Objective-C binding, gobind generates a protocol that declares
130129
methods corresponding to Go interface's methods.
131130
@@ -154,32 +153,31 @@ The Objective-C implementation can be used like so:
154153
SysPrint* printer = [[SysPrint alloc] init];
155154
GoMyfmtPrintHello(printer);
156155
157-
158-
Type restrictions
156+
# Type restrictions
159157
160158
At present, only a subset of Go types are supported.
161159
162160
All exported symbols in the package must have types that are supported.
163161
Supported types include:
164162
165-
- Signed integer and floating point types.
163+
- Signed integer and floating point types.
166164
167-
- String and boolean types.
165+
- String and boolean types.
168166
169-
- Byte slice types. Note that byte slices are passed by reference,
170-
and support mutation.
167+
- Byte slice types. Note that byte slices are passed by reference,
168+
and support mutation.
171169
172-
- Any function type all of whose parameters and results have
173-
supported types. Functions must return either no results,
174-
one result, or two results where the type of the second is
175-
the built-in 'error' type.
170+
- Any function type all of whose parameters and results have
171+
supported types. Functions must return either no results,
172+
one result, or two results where the type of the second is
173+
the built-in 'error' type.
176174
177-
- Any interface type, all of whose exported methods have
178-
supported function types.
175+
- Any interface type, all of whose exported methods have
176+
supported function types.
179177
180-
- Any struct type, all of whose exported methods have
181-
supported function types and all of whose exported fields
182-
have supported types.
178+
- Any struct type, all of whose exported methods have
179+
supported function types and all of whose exported fields
180+
have supported types.
183181
184182
Unexported symbols have no effect on the cross-language interface, and
185183
as such are not restricted.
@@ -190,8 +188,7 @@ Go types, but this is a work in progress.
190188
Exceptions and panics are not yet supported. If either pass a language
191189
boundary, the program will exit.
192190
193-
194-
Reverse bindings
191+
# Reverse bindings
195192
196193
Gobind also supports accessing API from Java or Objective C from Go.
197194
Similar to how Cgo supports the magic "C" import, gobind recognizes
@@ -225,7 +222,7 @@ For more details on binding the the native API, see the design proposals,
225222
https://golang.org/issues/16876 (Java) and https://golang.org/issues/17102
226223
(Objective C).
227224
228-
Avoid reference cycles
225+
# Avoid reference cycles
229226
230227
The language bindings maintain a reference to each object that has been
231228
proxied. When a proxy object becomes unreachable, its finalizer reports
@@ -246,7 +243,7 @@ We recommend that implementations of foreign interfaces do not hold
246243
references to proxies of objects. That is: if you implement a Go
247244
interface in Java, do not store an instance of Seq.Object inside it.
248245
249-
Further reading
246+
# Further reading
250247
251248
Examples can be found in http://golang.org/x/mobile/example.
252249

cmd/gomobile/bind_androidapp.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func buildSrcJar(src string) error {
122122
// These entries are directly at the root of the archive.
123123
//
124124
// AndroidManifest.xml (mandatory)
125-
// classes.jar (mandatory)
125+
// classes.jar (mandatory)
126126
// assets/ (optional)
127127
// jni/<abi>/libgojni.so
128128
// R.txt (mandatory)

cmd/gomobile/build.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,11 @@ func goModTidyAt(at string, env []string) error {
354354
// parseBuildTarget parses buildTarget into 1 or more platforms and architectures.
355355
// Returns an error if buildTarget contains invalid input.
356356
// Example valid target strings:
357-
// android
358-
// android/arm64,android/386,android/amd64
359-
// ios,iossimulator,maccatalyst
360-
// macos/amd64
357+
//
358+
// android
359+
// android/arm64,android/386,android/amd64
360+
// ios,iossimulator,maccatalyst
361+
// macos/amd64
361362
func parseBuildTarget(buildTarget string) ([]targetInfo, error) {
362363
if buildTarget == "" {
363364
return nil, fmt.Errorf(`invalid target ""`)

cmd/gomobile/doc.go

+6-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

event/lifecycle/lifecycle.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ func (e Event) String() string {
5959
}
6060

6161
// Crosses reports whether the transition from From to To crosses the stage s:
62-
// - It returns CrossOn if it does, and the lifecycle change is positive.
63-
// - It returns CrossOff if it does, and the lifecycle change is negative.
64-
// - Otherwise, it returns CrossNone.
62+
// - It returns CrossOn if it does, and the lifecycle change is positive.
63+
// - It returns CrossOff if it does, and the lifecycle change is negative.
64+
// - Otherwise, it returns CrossNone.
65+
//
6566
// See the documentation for Stage for more discussion of positive and negative
6667
// crosses.
6768
func (e Event) Crosses(s Stage) Cross {

event/paint/paint.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ package paint // import "golang.org/x/mobile/event/paint"
99

1010
// Event indicates that the app is ready to paint the next frame of the GUI.
1111
//
12-
//A frame is completed by calling the App's Publish method.
12+
// A frame is completed by calling the App's Publish method.
1313
type Event struct {
1414
// External is true for paint events sent by the screen driver.
1515
//

example/basic/main.go

+8-7
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,20 @@
1313
//
1414
// Get the basic example and use gomobile to build or install it on your device.
1515
//
16-
// $ go get -d golang.org/x/mobile/example/basic
17-
// $ gomobile build golang.org/x/mobile/example/basic # will build an APK
16+
// $ go get -d golang.org/x/mobile/example/basic
17+
// $ gomobile build golang.org/x/mobile/example/basic # will build an APK
1818
//
19-
// # plug your Android device to your computer or start an Android emulator.
20-
// # if you have adb installed on your machine, use gomobile install to
21-
// # build and deploy the APK to an Android target.
22-
// $ gomobile install golang.org/x/mobile/example/basic
19+
// # plug your Android device to your computer or start an Android emulator.
20+
// # if you have adb installed on your machine, use gomobile install to
21+
// # build and deploy the APK to an Android target.
22+
// $ gomobile install golang.org/x/mobile/example/basic
2323
//
2424
// Switch to your device or emulator to start the Basic application from
2525
// the launcher.
2626
// You can also run the application on your desktop by running the command
2727
// below. (Note: It currently doesn't work on Windows.)
28-
// $ go install golang.org/x/mobile/example/basic && basic
28+
//
29+
// $ go install golang.org/x/mobile/example/basic && basic
2930
package main
3031

3132
import (

example/network/main.go

+9-8
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// In order to access the network from the Android app, its AndroidManifest.xml
1212
// file must include the permission to access the network.
1313
//
14-
// http://developer.android.com/guide/topics/manifest/manifest-intro.html#perms
14+
// http://developer.android.com/guide/topics/manifest/manifest-intro.html#perms
1515
//
1616
// The gomobile tool auto-generates a default AndroidManifest file by default
1717
// unless the package directory contains the AndroidManifest.xml. Users can
@@ -25,19 +25,20 @@
2525
//
2626
// Get the network example and use gomobile to build or install it on your device.
2727
//
28-
// $ go get -d golang.org/x/mobile/example/network
29-
// $ gomobile build golang.org/x/mobile/example/network # will build an APK
28+
// $ go get -d golang.org/x/mobile/example/network
29+
// $ gomobile build golang.org/x/mobile/example/network # will build an APK
3030
//
31-
// # plug your Android device to your computer or start an Android emulator.
32-
// # if you have adb installed on your machine, use gomobile install to
33-
// # build and deploy the APK to an Android target.
34-
// $ gomobile install golang.org/x/mobile/example/network
31+
// # plug your Android device to your computer or start an Android emulator.
32+
// # if you have adb installed on your machine, use gomobile install to
33+
// # build and deploy the APK to an Android target.
34+
// $ gomobile install golang.org/x/mobile/example/network
3535
//
3636
// Switch to your device or emulator to start the network application from
3737
// the launcher.
3838
// You can also run the application on your desktop by running the command
3939
// below. (Note: It currently doesn't work on Windows.)
40-
// $ go install golang.org/x/mobile/example/network && network
40+
//
41+
// $ go install golang.org/x/mobile/example/network && network
4142
package main
4243

4344
import (

exp/audio/al/al.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// On Ubuntu 14.04 'Trusty', you may have to install this library
1818
// by running the command below.
1919
//
20-
// sudo apt-get install libopenal-dev
20+
// sudo apt-get install libopenal-dev
2121
//
2222
// When compiled for Android, this package uses OpenAL Soft. Please add its
2323
// license file to the open source notices of your application.

exp/f32/f32.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// It is safe to use the destination address as the left-hand side,
1919
// that is, dst *= rhs is dst.Mul(dst, rhs).
2020
//
21-
// WARNING
21+
// # WARNING
2222
//
2323
// The interface to this package is not stable. It will change considerably.
2424
// Only use functions that provide package documentation. Semantics are

exp/f32/mat4.go

+2
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ func (m *Mat4) Perspective(fov Radian, aspect, near, far float32) {
9292

9393
// Scale sets m to be a scale followed by p.
9494
// It is equivalent to
95+
//
9596
// m.Mul(p, &Mat4{
9697
// {x, 0, 0, 0},
9798
// {0, y, 0, 0},
@@ -119,6 +120,7 @@ func (m *Mat4) Scale(p *Mat4, x, y, z float32) {
119120

120121
// Translate sets m to be a translation followed by p.
121122
// It is equivalent to
123+
//
122124
// m.Mul(p, &Mat4{
123125
// {1, 0, 0, x},
124126
// {0, 1, 0, y},

0 commit comments

Comments
 (0)