You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go version go1.9.2 windows/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\Administrator\go
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
What did you do?
Want to write a simple Anroid VPN app with reverse binding. I did a quick test based on the reverse example.
private Intent getServiceIntent() {
return new Intent(this, ToyVpnService.class);
}
What did you expect to see?
Compile OK
What did you see instead?
..\reverse\reverse.go:34:29: type net.VpnService is not an expression.
Change to a.StartService(gointent.New(this, gonet.VpnService.Class)) also doesn't help
the Go project does not use its bug tracker for general discussion or asking questions about the language. The Github bug tracker is only used for tracking bugs and proposals going through the Proposal Process.
Please see the Questions wiki page; it has a list of good places for asking questions. Thanks!
Closing, since it appears you are not reporting a Go bug.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.9.2 windows/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\Administrator\go
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
What did you do?
Want to write a simple Anroid VPN app with reverse binding. I did a quick test based on the reverse example.
So I make an attempt for try as
package reverse
import (
"Java/android/databinding/DataBindingUtil"
"Java/android/os"
"Java/android/net/VpnService"
gonet "Java/android/net"
gointent "Java/android/content/Intent"
"Java/android/support/v7/app"
gopkg "Java/reverse"
rlayout "Java/reverse/R/layout"
"Java/reverse/databinding"
"Java/reverse/databinding/ActivityMainBinding"
)
type MainActivity struct {
app.AppCompatActivity
binding databinding.ActivityMainBinding
}
func (a *MainActivity) OnCreate(this gopkg.MainActivity, b os.Bundle) {
this.Super().OnCreate(b)
db := DataBindingUtil.SetContentView(this, rlayout.Activity_main)
a.binding = ActivityMainBinding.Cast(db)
a.binding.SetAct(this)
VpnService.Prepare(this)
a.StartService(gointent.New(this, gonet.VpnService))
}
func (a *MainActivity) OnDestroy(this gopkg.MainActivity) {
a.binding = nil // break reference cycle
this.Super().OnDestroy()
}
func (a *MainActivity) GetLabel() string {
return "Hello from Go!"
}
main change is VpnService.Prepare(this) and a.StartService(gointent.New(this, gonet.VpnService)), which comes from ToyVPN:
startService(getServiceIntent().setAction(ToyVpnService.ACTION_DISCONNECT));
private Intent getServiceIntent() {
return new Intent(this, ToyVpnService.class);
}
What did you expect to see?
Compile OK
What did you see instead?
..\reverse\reverse.go:34:29: type net.VpnService is not an expression.
Change to a.StartService(gointent.New(this, gonet.VpnService.Class)) also doesn't help
For reverse binding, I mainly refer to #16876 @eliasnaur
Thanks
The text was updated successfully, but these errors were encountered: