OneSignal / onesignal-go-api

The official OneSignal API client for Go
MIT License
11 stars 7 forks source link

Unable to imprt onesignal #7

Closed iAmWillShepherd closed 2 years ago

iAmWillShepherd commented 2 years ago

I copy and paste the example from this [doc]() and got the following design-time error.

Unknown symbol *openapiclient
Screen Shot 2022-05-27 at 4 29 22 PM

@jmadler mentioned that this could be a typo, so I changed *openapiclient to onesignal as suggested and got another error stating that onesignal could not be imported.

Unable to import onesignal package
Screen Shot 2022-05-31 at 11 09 40 AM

I'm pretty sure I ran the go get sub-command, so this may be a bug.

go.mod
Screen Shot 2022-05-31 at 11 15 31 AM
rgomezp commented 2 years ago

Try importing like so:

package main

import (
    "context"
    "io"
    "math/rand"
    "net/http"
    "os"
    "strings"
    "testing"
    "time"

    "github.com/OneSignal/onesignal-go-api"

    "github.com/fatih/color"
)
iAmWillShepherd commented 2 years ago

That worked!