This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add iexplciit conversion to avoid warn
Create go.yml Update go.yml Update go.yml Update go.yml Update go.yml Update go.yml Update go.yml Update go.yml Update go.yml upgrade version and some lint fix in go mod Change Action
- Loading branch information
1 parent
93e5e3d
commit 44d59d7
Showing
11 changed files
with
109 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: Go | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
branches: ["master"] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
container: | ||
image: archlinux:latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set Up Arch Linux | ||
run: | | ||
pacman -Syy --noconfirm | ||
pacman -Syu --noconfirm | ||
pacman -S --noconfirm base-devel | ||
pacman -S --noconfirm libxml2 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
|
||
- name: Test | ||
run: go test ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
//go:generate go run internal/cmd/genwrapnode/genwrapnode.go -- dom/node_wrap.go | ||
package libxml2 | ||
|
||
/* | ||
Package libxml2 is an interface to libxml2 library, providing XML and HTML parsers | ||
with DOM interface. The inspiration is Perl5's XML::LibXML module. | ||
import ( | ||
"io" | ||
|
||
This library is still in very early stages of development. API may still change | ||
without notice. | ||
"github.com/lestrrat-go/libxml2/parser" | ||
"github.com/lestrrat-go/libxml2/types" | ||
) | ||
|
||
For the time being, the API is being written so that thye are as close as we | ||
can get to DOM Layer 3, but some methods will, for the time being, be punted | ||
and aliases for simpler methods that don't necessarily check for the DOM's | ||
correctness will be used. | ||
// Parse parses the given buffer and returns a Document. | ||
func Parse(buf []byte, o ...parser.Option) (types.Document, error) { | ||
p := parser.New(o...) | ||
return p.Parse(buf) | ||
} | ||
|
||
Also, the return values are still shaky -- I'm still debating how to handle error cases gracefully. | ||
*/ | ||
package libxml2 | ||
// ParseString parses the given string and returns a Document. | ||
func ParseString(s string, o ...parser.Option) (types.Document, error) { | ||
p := parser.New(o...) | ||
return p.ParseString(s) | ||
} | ||
|
||
// ParseReader parses XML from the given io.Reader and returns a Document. | ||
func ParseReader(rdr io.Reader, o ...parser.Option) (types.Document, error) { | ||
p := parser.New(o...) | ||
return p.ParseReader(rdr) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.