'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.

Overview

gotestsum

gotestsum runs tests using go test --json, prints formatted test output, and a summary of the test run. It is designed to work well for both local development, and for automation like CI. gotest.tools/gotestsum/testjson (godoc) is a library that can be used to read test2json output.

See documentation.

Install

Download a binary from releases, or build from source with go get gotest.tools/gotestsum.

Demo

A demonstration of three --format options.

Demo
Source

Documentation

Output Format

The --format flag or GOTESTSUM_FORMAT environment variable set the format that is used to print the test names, and possibly test output, as the tests run. Most outputs use color to highlight pass, fail, or skip.

Commonly used formats (see --help for a full list):

  • dots - print a character for each test.
  • pkgname (default) - print a line for each package.
  • testname - print a line for each test and package.
  • standard-quiet - the standard go test format.
  • standard-verbose - the standard go test -v format.

Have an idea for a new format? Please share it on github!

Summary

Following the formatted output is a summary of the test run. The summary includes:

  • The test output, and elapsed time, for any test that fails or is skipped.

  • The build errors for any package that fails to build.

  • A DONE line with a count of tests run, tests skipped, tests failed, package build errors, and the elapsed time including time to build.

    DONE 101 tests[, 3 skipped][, 2 failures][, 1 error] in 0.103s
    

To hide parts of the summary use --hide-summary section.

Example: hide skipped tests in the summary

gotestsum --hide-summary=skipped

Example: hide everything except the DONE line

gotestsum --hide-summary=skipped,failed,errors,output
# or
gotestsum --hide-summary=all

Example: hide test output in the summary, only print names of failed and skipped tests and errors

gotestsum --hide-summary=output

JUnit XML output

When the --junitfile flag or GOTESTSUM_JUNITFILE environment variable are set to a file path, gotestsum will write a test report, in JUnit XML format, to the file. This file can be used to integrate with CI systems.

gotestsum --junitfile unit-tests.xml

If the package names in the testsuite.name or testcase.classname fields do not work with your CI system these values can be customized using the --junitfile-testsuite-name, or --junitfile-testcase-classname flags. These flags accept the following values:

  • short - the base name of the package (the single term specified by the package statement).
  • relative - a package path relative to the root of the repository
  • full - the full package path (default)

Note: If Go is not installed, or the go binary is not in PATH, the GOVERSION environment variable can be set to remove the "failed to lookup go version for junit xml" warning.

JSON file output

When the --jsonfile flag or GOTESTSUM_JSONFILE environment variable are set to a file path, gotestsum will write a line-delimited JSON file with all the test2json output that was written by go test --json. This file can be used to compare test runs, or find flaky tests.

gotestsum --jsonfile test-output.log

Post Run Command

The --post-run-command flag may be used to execute a command after the test run has completed. The binary will be run with the following environment variables set:

GOTESTSUM_FORMAT        # gotestsum format (ex: short)
GOTESTSUM_JSONFILE      # path to the jsonfile, empty if no file path was given
GOTESTSUM_JUNITFILE     # path to the junit.xml file, empty if no file path was given
TESTS_ERRORS            # number of errors
TESTS_FAILED            # number of failed tests
TESTS_SKIPPED           # number of skipped tests
TESTS_TOTAL             # number of tests run

To get more details about the test run, such as failure messages or the full list of failed tests, run gotestsum with either a --jsonfile or --junitfile and parse the file from the post-run-command. The gotestsum/testjson package may be used to parse the JSON file output.

Example: desktop notifications

First install the example notification command with go get gotest.tools/gotestsum/contrib/notify. The command will be downloaded to $GOPATH/bin as notify. Note that this example notify command only works on macOS with terminal-notifer installed.

gotestsum --post-run-command notify

Re-running failed tests

When the --rerun-fails flag is set, gotestsum will re-run any failed tests. The tests will be re-run until each passes once, or the number of attempts exceeds the maximum attempts. Maximum attempts defaults to 2, and can be changed with --rerun-fails=n.

To avoid re-running tests when there are real failures, the re-run will be skipped when there are too many test failures. By default this value is 10, and can be changed with --rerun-fails-max-failures=n.

Note that using --rerun-fails may require the use of other flags, depending on how you specify args to go test:

  • when used with --raw-command the re-run will pass additional arguments to the command. The first arg is a -test.run flag with a regex that matches the test to re-run, and second is the name of a go package. These additional args can be passed to go test, or a test binary.

  • when used with any go test args (anything after -- on the command line), the list of packages to test must be specified as a space separated list using the --packages arg.

    Example

    gotestsum --rerun-fails --packages="./..." -- -count=2
    
  • if any of the go test args should be passed to the test binary, instead of go test itself, the -args flag must be used to separate the two groups of arguments. -args is a special flag that is understood by go test to indicate that any following args should be passed directly to the test binary.

    Example

    gotestsum --rerun-fails --packages="./..." -- -count=2 -args -update-golden
    

Custom go test command

By default gotestsum runs tests using the command go test --json ./.... You can change the command with positional arguments after a --. You can change just the test directory value (which defaults to ./...) by setting the TEST_DIRECTORY environment variable.

You can use --debug to echo the command before it is run.

Example: set build tags

gotestsum -- -tags=integration ./...

Example: run tests in a single package

gotestsum -- ./io/http

Example: enable coverage

gotestsum -- -coverprofile=cover.out ./...

Example: run a script instead of go test

gotestsum --raw-command -- ./scripts/run_tests.sh

Note: when using --raw-command you must ensure that the stdout produced by the script only contains the test2json output. Any stderr produced by the script will be considered an error (this behaviour is necessary because package build errors are only reported by writting to stderr, not the test2json stdout). Any stderr produced by tests is not considered an error (it will be in the test2json stdout).

Example: using TEST_DIRECTORY

TEST_DIRECTORY=./io/http gotestsum

Executing a compiled test binary

gotestsum supports executing a compiled test binary (created with go test -c) by running it as a custom command.

The -json flag is handled by go test itself, it is not available when using a compiled test binary, so go tool test2json must be used to get the output that gotestsum expects.

Example: running ./binary.test

gotestsum --raw-command -- go tool test2json -t -p pkgname ./binary.test -test.v

pkgname is the name of the package being tested, it will show up in the test output. ./binary.test is the path to the compiled test binary. The -test.v must be included so that go tool test2json receives all the output.

To execute a test binary without installing Go, see running without go.

Finding and skipping slow tests

gotestsum tool slowest reads test2json output, from a file or stdin, and prints the names and elapsed time of slow tests. The tests are sorted from slowest to fastest.

gotestsum tool slowest can also rewrite the source of tests slower than the threshold, making it possible to optionally skip them.

The test2json output can be created with gotestsum --jsonfile or go test -json.

See gotestsum tool slowest --help.

Example: printing a list of tests slower than 500 milliseconds

$ gotestsum --format dots --jsonfile json.log
[.]····↷··↷·
$ gotestsum tool slowest --jsonfile json.log --threshold 500ms
gotest.tools/example TestSomething 1.34s
gotest.tools/example TestSomethingElse 810ms

Example: skipping slow tests with go test --short

Any test slower than 200 milliseconds will be modified to add:

if testing.Short() {
    t.Skip("too slow for testing.Short")
}
go test -json -short ./... | gotestsum tool slowest --skip-stmt "testing.Short" --threshold 200ms

Use git diff to see the file changes. The next time tests are run using --short all the slow tests will be skipped.

Run tests when a file is saved

When the --watch flag is set, gotestsum will watch directories using file system notifications. When a Go file in one of those directories is modified, gotestsum will run the tests for the package which contains the changed file. By default all directories under the current directory will be watched. Use the --packages flag to specify a different list.

While in watch mode, pressing some keys will perform an action:

  • r will run tests for the previous event.
  • d will run tests for the previous event using dlv test, allowing you to debug a test failure using delve A breakpoint will automatically be added at the first line of any tests which failed in the previous run. Additional breakpoints can be added with runtime.Breakpoint or by using the delve command prompt.

Note that delve must be installed in order to use debug (d).

Example: run tests for a package when any file in that package is saved

gotestsum --watch --format testname

Development

Godoc CircleCI Go Reportcard

Pull requests and bug reports are welcome! Please open an issue first for any big changes.

Thanks

This package is heavily influenced by the pytest test runner for python.

Issues
  • Passing tests reported as failures in summary

    Passing tests reported as failures in summary

    We are using gotestsum to run our testing for Knative, and digging into some recent "failures", I can't really make sense of why gotestsum is reporting them as failed.

    The failure log I have been digging through can be downloaded from here, the file you want is "build-log.txt" (it is large).

    In this test run I see the following summary:

    === Skipped
    === SKIP: test/e2e TestProbeWhitelist (0.00s)
        probe_whitelist_test.go:38: RequestAuthentication dropped the regex support. We need to rewrite this test. See https://github.com/istio/istio/issues/16585
    
    
    === Failed
    === FAIL: test/conformance/api/v1alpha1 TestContainerExitingMsg/http (unknown)
    
    === FAIL: test/conformance/api/v1alpha1 TestContainerExitingMsg/tcp (unknown)
    

    However, if I scan back through the test logs, I see that all of the flavors of TestContainerExitingMsg have passed, here's one cluster:

    --- PASS: TestContainerExitingMsg (0.00s)
        --- PASS: TestContainerExitingMsg/http (40.29s)
        --- PASS: TestContainerExitingMsg/tcp (172.49s)
    

    I've been trying to make sense of the pieces of information here, but basically all I've managed so far is that (unknown) seems to tell us that the elapsed time is unknown, which seems to point to a TestCase terminated by the end() method here.

    Any pointers would be appreciated. 🙏

    bug test2json-bug 
    opened by mattmoor 19
  • support goarch mips64le architecture.

    support goarch mips64le architecture.

    hello,I am going to submit mips64le architecture,The main reasons for adding support for mips64le architecture are: 1、The mips64le architecture is also the mainstream cpu architecture (amd64, arm64), which is used by many users; 2、Golang supports cross compilation, and mips64le is officially supported. Therefore, I hope that the release package also supports the mips64le architecture, which is convenient for more users. Signed-off-by: houfangdong [email protected]

    opened by houfangdong 10
  • Execution time is 0.00s when using gotestsum with binary.

    Execution time is 0.00s when using gotestsum with binary.

    I'am trying to use gotestsum in following way: gotestsum -f short-verbose --raw-command -- go tool test2json -p test ./test/run-tests -test.v

    Test are running without problem but time execution of any test is 0.00s. F.e.: PASS test.TestSomeFoo (0.00s)

    Overall test execution time is reported properly. Am I missing something?

    docs 
    opened by alufrew 9
  • dots formatting broken in v0.4.1

    dots formatting broken in v0.4.1

    Upgrading to v0.4.1 has broken dots formatting. It's now printing out a huge amount of output like this:

        🖴  internal/pkg/jwt ·······
        🖴  internal/pkg/random ·
        🖴  internal/pkg/httputil ···············
        🖴  internal/pkg/retry ···
        🖴  internal/migrator ··
        🖴  internal/api/audit ·········
        🖴  internal/blah··········································
    

    command used:

    gotestsum --format dots ./...
    

    platform: OSX 10.15.1

    Cheers

    opened by jonasdebeukelaer 9
  • [go1.13.x] Error handling TestMain logic

    [go1.13.x] Error handling TestMain logic

    If TestMain exits 0 (or just returns) and no tests are executed, the package will show as failed. See: https://github.com/DataDog/datadog-agent/pull/5294

    func TestMain(m *testing.M) {
    	if _, ok := os.LookupEnv("INTEGRATION"); !ok {
    		log.Println("--- SKIP: to run tests in this package, set the INTEGRATION environment variable")
    		os.Exit(0)
    	}
    	os.Exit(m.Run())
    }
    
    === Failed
    === FAIL: pkg/trace/test/testsuite  (0.00s)
    2020/04/15 15:35:55 --- SKIP: to run tests in this package, set the INTEGRATION environment variable
    ok  	github.com/DataDog/datadog-agent/pkg/trace/test/testsuite	1.015s
    
    test2json-bug 
    opened by ofek 8
  • Module go download logs appearing as Errors (go v1.11)

    Module go download logs appearing as Errors (go v1.11)

    Hey, I'm using the following command to run tests:

    gotestsum -- ./api/...
    

    inside a golang:1.11.1-stretch docker container, and also locally (mac), and getting the following output

    ∅ bitbucket.com/satalia/engine/api/healthsvc
    ∅ bitbucket.com/satalia/engine/api/healthsvc/endpoints
    ✓ bitbucket.com/satalia/engine/api/healthsvc/service (5ms)
    ∅ bitbucket.com/satalia/engine/api/healthsvc/transport
    
    === Errors
    go: downloading github.com/go-kit/kit v0.7.0
    go: downloading github.com/golang/protobuf v1.2.0
    go: downloading google.golang.org/grpc v1.15.0
    go: downloading golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1
    go: downloading google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8
    go: downloading golang.org/x/text v0.3.0
    go: downloading github.com/go-logfmt/logfmt v0.3.0
    go: downloading github.com/go-stack/stack v1.8.0
    
    DONE 1 tests, 8 errors in 29.465s
    

    whereas if I run using go test ./api/... I get none of the go downloading errors.

    We are using go modules to manage dependencies (a file called go.mod) contains all the required packages, could this be an issue?

    bug 
    opened by jonasdebeukelaer 8
  • Duplicate test names in JUnit XML

    Duplicate test names in JUnit XML

    I used this invocation of gotestsum:

    gotestsum --format standard-verbose --junitfile report.xml --jsonfile report.json -- -test.run TestMySuite
    

    The output XML looks like:

    <?xml version="1.0" encoding="UTF-8"?>
    <testsuites>
            <testsuite tests="11" failures="0" time="5806.690s" name="MySuite">
                    <properties>
                            <property name="go.version" value="go1.10.3"></property>
                    </properties>
                    <testcase classname="job" name="TestOne" time="75.350s"></testcase>
                    <testcase classname="job" name="TestOne" time="76.680s"></testcase>
                    <testcase classname="job" name="TestTwo" time="86.110s"></testcase>
                    <testcase classname="job" name="TestTwo" time="86.990s"></testcase>
                    <testcase classname="job" name="TestThree" time="188.780s"></testcase>
                    <testcase classname="job" name="TestThree" time="189.740s"></testcase>
                    <testcase classname="job" name="TestMySuite" time="11.570s"></testcase>
                    <testcase classname="job" name="TestMySuite" time="1937.300s"></testcase>
            </testsuite>
    </testsuites>
    

    The JSON is pretty big, but if I cut it down, it looks something like:

    {"Time":"2018-08-02T08:18:13.739327862Z","Action":"run","Package":"MySuite","Test":"TestOne"}
    {"Time":"2018-08-02T08:19:30.419938008Z","Action":"pass","Package":"MySuite","Test":"TestOne","Elapsed":75.35}
    {"Time":"2018-08-02T08:19:30.419959464Z","Action":"output","Package":"MySuite","Test":"TestOne","Output":"--- PASS: TestOne (76.68s)\n"}
    {"Time":"2018-08-02T08:19:30.419971053Z","Action":"pass","Package":"MySuite","Test":"TestOne","Elapsed":76.68}
    {"Time":"2018-08-02T08:19:30.419976409Z","Action":"run","Package":"MySuite","Test":"TestTwo"}
    {"Time":"2018-08-02T08:20:57.405652904Z","Action":"pass","Package":"MySuite","Test":"TestTwo","Elapsed":86.11}
    {"Time":"2018-08-02T08:20:57.405663056Z","Action":"output","Package":"MySuite","Test":"TestTwo","Output":"--- PASS: TestTwo (86.99s)\n"}
    {"Time":"2018-08-02T08:20:57.405671178Z","Action":"pass","Package":"MySuite","Test":"TestTwo","Elapsed":86.99}
    {"Time":"2018-08-02T08:20:57.405676436Z","Action":"run","Package":"MySuite","Test":"TestThree"}
    {"Time":"2018-08-02T08:24:07.146323211Z","Action":"pass","Package":"MySuite","Test":"TestThree","Elapsed":188.78}
    {"Time":"2018-08-02T08:24:07.146333316Z","Action":"output","Package":"MySuite","Test":"TestThree","Output":"--- PASS: TestThree (189.74s)\n"}
    {"Time":"2018-08-02T08:24:07.146340153Z","Action":"pass","Package":"MySuite","Test":"TestThree","Elapsed":189.74}
    
    {"Time":"2018-08-02T08:50:27.611048188Z","Action":"pass","Package":"MySuite","Test":"MySuite","Elapsed":11.57}
    {"Time":"2018-08-02T08:50:27.611767989Z","Action":"pass","Package":"MySuite","Test":"MySuite","Elapsed":1937.3}
    {"Time":"2018-08-02T08:50:27.611054838Z","Action":"output","Package":"MySuite","Test":"MySuite","Output":"--- PASS: MySuite (1937.30s)\n"}
    {"Time":"2018-08-02T08:50:27.61302664Z","Action":"pass","Package":"MySuite","Elapsed":1937.313}
    

    Any idea why lines with "Action":"pass" appear twice for the same test?

    I am using go 1.10.3

    question 
    opened by rodrigc 8
  • Add attribute `file` to JUnit XML report to accommodate CircleCI algorithm for splitting tests

    Add attribute `file` to JUnit XML report to accommodate CircleCI algorithm for splitting tests

    Hi,

    CircleCI allows to split tests by timings using a JUnit XML report. Unfortunately it requires testcase to have an file attribute in order to properly work as detailed in this CircleCI forum question. I have confirmed it by manipulating the JUnit XML report output of gotestsum. I understand that file is not part of the JUnit XSD but it would really help if it could be added to the output if the user wanted it. What are your thoughts?

    opened by yterradas 7
  • possible bug: build errors passes except when rerun is required

    possible bug: build errors passes except when rerun is required

    I have a test that has build errors in it with rerun is enabled, which I think causes it to pass, except when there are test errors. When there are individual test errors, it reports:

    ERROR rerun aborted because previous run had errors
    

    But otherwise, it passes.

    It seems inconsistent to me that the build would pass, except when a test needs a rerun. This makes it hard to know there is a problem until a test fails.

    Just for context, the failures are because I'm trying to run with coverage and --coverpkg must include only packages that are included in the build, so we get a few errors like this in the error report:

    warning: no packages being tested depend on matches for pattern ...
    

    Might we want this test to fail immediately rather than only when a rerun is required?

    bug 
    opened by ashanbrown 7
  • Build broken

    Build broken

    Looks like a recent commit broke the build:

    go get -u gotest.tools/gotestsum
    # gotest.tools/gotestsum
    ../go/src/gotest.tools/gotestsum/main.go:394:5: cannot use exec.ExitError literal (type *exec.ExitError) as type exitCoder in assignment:
    	*exec.ExitError does not implement exitCoder (missing ExitCode method)
    

    Since this is open source, why not use CircleCI's free tier for running builds automatically?

    question 
    opened by robbrit 7
  • Execution time is slower with go 1.14

    Execution time is slower with go 1.14

    Hello !

    I don't understand why, but when i run my tests with gotestsum and go 1.14, it's slower than with go 1.13.

    G0 1.14

    image

    Go 1.13

    image

    If you need more information i can help :smile:

    bug 
    opened by jsdidierlaurent 7
  • Add Support for s390x and ppc64le

    Add Support for s390x and ppc64le

    @dnephin I saw a couple PRs and additions for various architectures like #181. Would you be open to adding s390x and ppc64le?

    s390x refers to the mainframe architecture on Linux or common referred to Linux on Z. While ppc64le refers to the Power architecture. Both architectures are made by IBM, even though some of it is open source.

    From my experience both s390x and ppc64le both have great support in GO and usually cross compile without issue.

    I believe the .goreleaser.yml would need to be update to look something like:

    
    project_name: gotestsum
    
    release:
      github:
        owner: gotestyourself
        name: gotestsum
    
    builds:
      - binary: gotestsum
        goos:
          - darwin
          - windows
          - linux
        goarch:
          - amd64
          - arm64
          - arm
          - s390x
          - ppc64le
        env: [CGO_ENABLED=0]
        ldflags: ["-s -w -X gotest.tools/gotestsum/cmd.version={{.Version}}"]
    
    checksum:
      name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt'
    
    

    @dnephin If you are open to support those architecture, I can submit a PR for you if you would like!

    opened by james-crowley 1
  • [enhancement] Add a parameter to set

    [enhancement] Add a parameter to set "maximum failure message length" or a parameter "don't include error message"

    Hello gotestsum team. I use gotestsum to generate reports for GitHub Actions. GitHub Actions have limitations: "The report size cannot exceed 1 MB".

    After my test, gotestsum-report.xml contains the full log of the failed test. The length of the log is ~ 10 MB, as a result, GitHub actions cannot process this file.

    Is it possible to add a parameter?: MaximumErrorMessageLength or Don't_Include_ErrorMessage.

    By the way, I tried to find a way to not include the full log into gotestsum-report.xml . It sounds more convenient to add only an assert or panic stack trace into test report, but I have not found this way.

    An example of xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <testsuites>
    	<testsuite tests="3" failures="2" time="6.359000" name="github.com/myProject/..." timestamp="2022-06-24T11:45:24+03:00">
    		<properties>
    			<property name="go.version" value="go1.18beta1 darwin/arm64"></property>
    		</properties>
    		<testcase classname="github.com/myProject/..." name="MyTest/test1" time="2.500000">
    			<failure message="Failed" type=""> Message with lenght > 1mb</failure>
    		</testcase>
    	</testsuite>
    </testsuites>
    
    enhancement 
    opened by vince-duloup 5
  • Visual Studio Code integration?

    Visual Studio Code integration?

    Hi,

    Inside VSCode we can specify some settings like:

      "go.testFlags": ["-v", "-count=1"],
      "go.testTimeout": "120s",
    

    I'm wondering if someone here has integrated gotestsum so VSCode will use it when running tests from the code editor (arrows above test functions)?

    Looking for this because having the same output between IDE triggers and manual CLI would be great 👍

    Thank you,

    question 
    opened by sneko 0
  • Add tool ci-matrix

    Add tool ci-matrix

    This PR adds a new subcommand gotestsum tool ci-matrix for use with github actions. The subcommand:

    • reads test2json files saved in a github actions cache from previous test runs
    • uses the test2json data to calculate the 85th percentile runtime of each package
    • uses the package runtime to bucket all the packages into n buckets

    A github actions workflow can then use those buckets in a matrix, so that packages are split between the buckets based on their runtime. This should result in optimal splitting of packages so minimize overall CI runtime.

    Using the subcommand requires integration with github action works, so I'll need to document exact how to wire it all together. Once it's working well, maybe it would make sense to publish an action to handle parts of it.

    opened by dnephin 0
  • Add Release for x86 Architectures

    Add Release for x86 Architectures

    Hi there, I want to be able to build gotestsum to be used on older Windows systems (7 32 bit, 10 32 bit) for my CI tooling 😄. I don't find any instructions on compiling on the README though, so I just download the latest release by curling from https://github.com/gotestyourself/gotestsum/releases/latest

    Right now only arm64, arm 32 bit and amd64 architectures available .. Could the goreleaser be modified to add 386 as a target architecture to add to future releases?

    Better yet, is there a way I can compile the code myself easily that I'm missing? I know I can install a local version but want to be able to compile for other platforms and architectures

    Similar solutions from previous issues maybe:

    • https://github.com/gotestyourself/gotestsum/issues/180
    • https://github.com/gotestyourself/gotestsum/pull/245
    opened by erinf-wolf 4
  • parse outputs for garbled passes to avoid spurious failures

    parse outputs for garbled passes to avoid spurious failures

    Implements this suggestion -- updates the execution to search output events for the PASS output string. It will then count those as pass events (if no true pass event is encountered). As per https://github.com/golang/go/issues/26325, test2json occasionally has issues with interleaving stdout logs and test result logs, leading to output lines like

    "Output":"[example.go--- PASS: TestExample (0.08s)\n"
    

    The extra text in the output breaks test2json's ability to detect that this is in fact a pass, and as a result we get neither a pass nor fail event in the output json. With this change, we will still be able to count this as a pass.

    opened by MisterSquishy 3
Releases(v1.8.1)
Decode / encode XML to/from map[string]interface{} (or JSON); extract values with dot-notation paths and wildcards. Replaces x2j and j2x packages.

mxj - to/from maps, XML and JSON Decode/encode XML to/from map[string]interface{} (or JSON) values, and extract/modify values from maps by key or key-

Charles Banning 523 Aug 7, 2022
omniparser: a native Golang ETL streaming parser and transform library for CSV, JSON, XML, EDI, text, etc.

omniparser Omniparser is a native Golang ETL parser that ingests input data of various formats (CSV, txt, fixed length/width, XML, EDI/X12/EDIFACT, JS

JF Technology 484 Aug 12, 2022
Convert xml and json to go struct

xj2go The goal is to convert xml or json file to go struct file. Usage Download and install it: $ go get -u -v github.com/wk30/xj2go/cmd/... $ xj [-t

null 26 Jul 21, 2022
parse and generate XML easily in go

etree The etree package is a lightweight, pure go package that expresses XML in the form of an element tree. Its design was inspired by the Python Ele

Brett Vickers 979 Aug 7, 2022
Go XML sitemap and sitemap index generator

Install go get github.com/turk/go-sitemap Example for sitemapindex func () main(c *gin.Context) { s := sitemap.NewSitemapIndex(c.Writer, true)

Suleyman Yilmaz 3 Jun 29, 2022
This package provides Go (golang) types and helper functions to do some basic but useful things with mxGraph diagrams in XML, which is most famously used by app.diagrams.net, the new name of draw.io.

Go Draw - Golang MX This package provides types and helper functions to do some basic but useful things with mxGraph diagrams in XML, which is most fa

null 1 Nov 30, 2021
Quick and simple parser for PFSense XML configuration files, good for auditing firewall rules

pfcfg-parser version 0.0.1 : 13 January 2022 A quick and simple parser for PFSense XML configuration files to generate a plain text file of the main c

Rory Campbell-Lange 0 Jan 13, 2022
Sqly - An easy-to-use extension for sqlx, base on xml files and named query/exec

sqly An easy-to-use extension for sqlx ,base on xml files and named query/exec t

nvac 1 Jun 12, 2022
xmlquery is Golang XPath package for XML query.

xmlquery Overview xmlquery is an XPath query package for XML documents, allowing you to extract data or evaluate from XML documents with an XPath expr

null 301 Aug 1, 2022
Extraction politique de conformité : xlsx (fichier de suivi) -> xml (format AlgoSec)

go_policyExtractor Extraction politique de conformité : xlsx (fichier de suivi) -> xml (format AlgoSec). Le programme suivant se base sur les intitulé

Nokeni 0 Nov 4, 2021
axmlfmt is an opinionated formatter for Android XML resources

axmlfmt axmlfmt is an opinionated formatter for Android XML resources. It takes XML that looks like <?xml version="1.0" encoding="utf-8"?> <LinearLayo

Rashad Sookram 2 May 14, 2022
Freestyle xml parser with golang

fxml - FreeStyle XML Parser This package provides a simple parser which reads a XML document and output a tree structure, which does not need a pre-de

null 8 Jul 1, 2022
🧑‍💻 Go XML generator without Structs™

exml ??‍?? Go XML generator without Structs™ Package exml allows XML documents to be generated without the usage of structs or maps. It is not intende

Victor 2 May 16, 2022
wikipedia-jsonl is a CLI that converts Wikipedia dump XML to JSON Lines format.

wikipedia-jsonl wikipedia-jsonl is a CLI that converts Wikipedia dump XML to JSON Lines format. How to use At first, download the XML dump from Wikime

Minoru Osuka 2 Feb 13, 2022
:sushi: emoji terminal output for golang

Emoji Emoji is a simple golang package. Get it: go get github.com/kyokomi/emoji/v2 Import it: import ( "github.com/kyokomi/emoji/v2" ) Usage packag

kyokomi 706 Aug 7, 2022
Parse data and test fixtures from markdown files, and patch them programmatically, too.

go-testmark Do you need test fixtures and example data for your project, in a language agnostic way? Do you want it to be easy to combine with documen

Eric Myhre 19 Aug 8, 2022
Pagser is a simple, extensible, configurable parse and deserialize html page to struct based on goquery and struct tags for golang crawler

Pagser Pagser inspired by page parser。 Pagser is a simple, extensible, configurable parse and deserialize html page to struct based on goquery and str

foolin 68 Aug 10, 2022
[Go] Package of validators and sanitizers for strings, numerics, slices and structs

govalidator A package of validators and sanitizers for strings, structs and collections. Based on validator.js. Installation Make sure that Go is inst

Alex Saskevich 5.4k Aug 6, 2022
Take screenshots of websites and create PDF from HTML pages using chromium and docker

gochro is a small docker image with chromium installed and a golang based webserver to interact wit it. It can be used to take screenshots of w

Christian Mehlmauer 49 Jul 13, 2022