- Consolidate _demo, _pydemo, _embdemo into single _demo directory structure
- Organize demos by language: _demo/{go,py,c,embed}/
- Categorize demos based on imports:
- Python library demos (py imports) → _demo/py/
- C/C++ library demos (c/cpp imports) → _demo/c/
- Go-specific demos → _demo/go/
- Embedded demos → _demo/embed/
- Move C-related demos (asm*, cabi*, cgo*, linkname, targetsbuild) from go/ to c/
- Update all path references in README.md and GitHub workflows
- Improve demo organization and navigation as requested in #1256
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
21 lines
390 B
Go
21 lines
390 B
Go
package main
|
|
|
|
import (
|
|
"github.com/goplus/lib/c"
|
|
"github.com/goplus/lib/c/net"
|
|
)
|
|
|
|
func main() {
|
|
var hints net.AddrInfo
|
|
hints.Family = net.AF_UNSPEC
|
|
hints.SockType = net.SOCK_STREAM
|
|
|
|
host := "httpbin.org"
|
|
port := "80"
|
|
|
|
var result *net.AddrInfo
|
|
c.Printf(c.Str("%d\n"), net.Getaddrinfo(c.Str(host), c.Str(port), &hints, &result))
|
|
|
|
c.Printf(c.Str("%d\n"), net.Freeaddrinfo(result))
|
|
}
|