Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set environment variables in CreateProcess? #33

Open
UnderCooled opened this issue Jan 21, 2024 · 0 comments
Open

How to set environment variables in CreateProcess? #33

UnderCooled opened this issue Jan 21, 2024 · 0 comments

Comments

@UnderCooled
Copy link

  proxy := readConfig()
  env := []struct {
    name string
    val string
  }{{"HTTPS_PROXY", proxy}, {"HTTP_PROXY", proxy}}
  
  win.CreateProcess(
    win.StrOptSome("C:\\Program Files (x86)\\AppFlowy\\AppFlowy.exe"),
    win.StrOptSome(""), &mySecurityAttr, &mySecurityAttr, true, co.CREATE_NO_WINDOW,
    env,
    win.StrOptSome("."), &myStartupInfo, &myProcessInfo)
go version go1.21.6 windows/amd64

.\appflowy_proxifier.go:59:5: cannot use env (variable of type []struct{name string; val string}) as []struct{name string; val string} value in argument to win.CreateProcess

This error is confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant