Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 17 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
language: go
sudo: false

go:
- 1.9
- tip

services:
- mongodb

go:
- 1.11.x
- 1.12.x
- 1.13
- tip

env:
global:
- GO111MODULE=on
- MONGODB_TEST_CXN=localhost
matrix:
- FIX_TEST=
Expand All @@ -25,9 +28,16 @@ env:
matrix:
allow_failures:
- go: tip
fast_finish: true
exclude:
- go: 1.13.x
env: GO111MODULE=on
- go: tip
env: GO111MODULE=on

install:
- go get -u github.com/golang/dep/cmd/dep
- dep ensure
before_install:
- if [[ "${GO111MODULE}" = "on" ]]; then mkdir "${HOME}/go"; export GOPATH="${HOME}/go"; fi
- if [[ "${GO111MODULE}" = "on" ]]; then export PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"; fi
- go mod download

script: make generate; if [ -z "$FIX_TEST" ]; then make build; make; else make build_accept; make $FIX_TEST; fi
97 changes: 0 additions & 97 deletions Gopkg.lock

This file was deleted.

34 changes: 0 additions & 34 deletions Gopkg.toml

This file was deleted.

5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
all: vet test

generate:
clean:
rm -rf gen

generate: clean
mkdir -p gen; cd gen; go run ../cmd/generate-fix/generate-fix.go ../spec/*.xml

generate-dist:
Expand Down
51 changes: 14 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,16 @@ Following installation, `generate-fix` is installed to `$GOPATH/bin/generate-fix
Developing QuickFIX/Go
----------------------

If you wish to work on QuickFIX/Go itself, you will first need [Go](http://www.golang.org) installed on your machine (version 1.6+ is *required*).
If you wish to work on QuickFIX/Go itself, you will first need [Go](http://www.golang.org) installed and configured on your machine (version 1.13+ is preferred, but the minimum required version is 1.6).

For local dev first make sure Go is properly installed, including setting up a [GOPATH](http://golang.org/doc/code.html#GOPATH).

Next, using [Git](https://git-scm.com/), clone this repository into `$GOPATH/src/github.com/quickfixgo/quickfix`.
Next, using [Git](https://git-scm.com/), clone the repository via `git clone [email protected]:quickfixgo/quickfix.git`

### Installing Dependencies

QuickFIX/Go uses [dep](https://github.com/golang/dep) to manage the vendored dependencies. Install dep with `go get`:

```sh
$ go get -u github.com/golang/dep/cmd/dep
```

Run `dep ensure` to install the correct versioned dependencies into `vendor/`, which Go 1.6+ automatically recognizes and loads.
As of Go version 1.13, QuickFIX/Go uses [modules](https://github.com/golang/go/wiki/Modules) to manage dependencies. You may require `GO111MODULE=on`. To install dependencies, run

```sh
$ $GOPATH/bin/dep ensure
go mod download
```

**Note:** No vendored dependencies are included in the QuickFIX/Go source.
Expand Down Expand Up @@ -117,37 +109,22 @@ To run acceptance tests,

If you are developing QuickFIX/Go, there are a few tasks you might need to perform related to dependencies.

#### Adding a dependency

If you are adding a dependency, you will need to update the dep manifest in the same Pull Request as the code that depends on it. You should do this in a separate commit from your code, as this makes PR review easier and Git history simpler to read in the future.
#### Adding/updating a dependency

To add a dependency:

1. Add the dependency using `dep`:
```bash
$ dep ensure -add github.com/foo/bar
```
2. Review the changes in git and commit them.
If you are adding or updating a dependency, you will need to update the `go.mod` and `go.sum` in the same Pull Request as the code that depends on it. You should do this in a separate commit from your code, as this makes PR review easier and Git history simpler to read in the future.

#### Updating a dependency

To update a dependency to the latest version allowed by constraints in `Gopkg.toml`:

1. Run:
```bash
$ dep ensure -update github.com/foo/bar
1. Add or update the dependency like usual:
```sh
go get -u github.com/foo/bar
```
2. Review the changes in git and commit them.

To change the allowed version/branch/revision of a dependency:

1. Manually edit `Gopkg.toml`
2. Run:
```bash
$ dep ensure
2. Update the module-related files:
```sh
go mod tidy
```
3. Review the changes in git and commit them.

Note that to specify a specific revision, you can manually edit the `go.mod` file and run `go mod tidy`

Licensing
---------

Expand Down
1 change: 1 addition & 0 deletions cmd/generate-fix/internal/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

var (
useFloat = flag.Bool("use-float", false, "By default, FIX float fields are represented as arbitrary-precision fixed-point decimal numbers. Set to 'true' to instead generate FIX float fields as float64 values.")
pkgRoot = flag.String("pkg-root", "github.com/quickfixgo", "Set a string here to provide a custom import path for generated packages.")
tabWidth = 8
printerMode = printer.UseSpaces | printer.TabIndent
)
Expand Down
17 changes: 1 addition & 16 deletions cmd/generate-fix/internal/helpers.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
package internal

import (
"os"
"path/filepath"
"strings"
)

// getImportPathRoot returns the root path to use in import statements.
// The root path is determined by stripping "$GOPATH/src/" from the current
// working directory. For example, when generating code within the QuickFIX/Go
// source tree, the returned root path will be "github.com/quickfixgo/quickfix".
func getImportPathRoot() string {
pwd, err := os.Getwd()
if err != nil {
panic(err)
}
goSrcPath := filepath.Join(os.Getenv("GOPATH"), "src")
importPathRoot := filepath.ToSlash(strings.Replace(pwd, goSrcPath, "", 1))
return strings.TrimLeft(importPathRoot, "/")
return *pkgRoot
}
Loading