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

Bugfix/add support curl8 #90

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
simpler example + execute cmd + link
  • Loading branch information
sprive committed Jul 16, 2024
commit 91b1d3e109b84e311b38e0448b359b3635526824
30 changes: 11 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,27 @@ Current Status
* Mac OS
* passed go1 (Mac OS X 10.7.3, curl 7.21.4)

NOTE: Above information is outdated ("help wanted")

Sample Program
--------------

Following comes from [examples/https.go](./examples/https.go)
Simply type `go run ./examples/https.go` to execute.
```go
package main

import (
"fmt"
curl "github.com/andelf/go-curl"
curl "github.com/andelf/go-curl"
)

func main() {
easy := curl.EasyInit()
defer easy.Cleanup()

easy.Setopt(curl.OPT_URL, "https://www.baidu.com/")

// OPTIONAL - make a callback function
fooTest := func (buf []byte, userdata interface{}) bool {
println("DEBUG: size=>", len(buf))
println("DEBUG: content=>", string(buf))
return true
}

easy.Setopt(curl.OPT_WRITEFUNCTION, fooTest)

if err := easy.Perform(); err != nil {
fmt.Printf("ERROR: %v\n", err)
}
easy := curl.EasyInit()
defer easy.Cleanup()
if easy != nil {
easy.Setopt(curl.OPT_URL, "https://baidu.com/")
easy.Perform()
}
}
```

Expand Down