Skip to content
Browse files

Merge pull request #4 from vmarkovtsev/master

goimports + docs
  • Loading branch information...
vmarkovtsev committed Oct 8, 2019
2 parents 51fde06 + 6cf5918 commit a0dc744a31f93d3ac6842de508b717275100c653
Showing with 153 additions and 3 deletions.
  1. +3 −0 .travis.yml
  2. +73 −0
  3. +53 −0
  4. +1 −0 MAINTAINERS
  5. +19 −1
  6. +3 −0 file.go
  7. +1 −2 file_test.go
@@ -19,6 +19,7 @@ matrix:
- go get -v
- go get -v
- go get -v

- go mod download
@@ -28,6 +29,8 @@ script:
- export PATH=$PATH:$HOME
- fmt_warns=$(gofmt -s -l .)
- if [ ! -z "$fmt_warns" ]; then echo "$fmt_warns"; exit 1; fi
- import_warns=$(goimports -l .)
- if [ ! -z "$import_warns" ]; then echo "$import_warns"; exit 1; fi
- go vet ./...
- lint_warns=$(golint ./... | grep -v vendor/) || true
- if [ ! -z "$lint_warns" ]; then echo "$lint_warns"; exit 1; fi
@@ -0,0 +1,73 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
education, socio-economic status, nationality, personal appearance, race,
religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at

@@ -0,0 +1,53 @@
# Contributing Guidelines

go-asdf project is [Apache 2.0 licensed](LICENSE) and accepts
contributions via GitHub pull requests. This document outlines some of the
conventions on development workflow, commit message formatting, contact points,
and other resources to make it easier to get your contribution accepted.

## Certificate of Origin

By contributing to this project you agree to the [Developer Certificate of
Origin (DCO)](DCO). This document was created by the Linux Kernel community and is a
simple statement that you, as a contributor, have the legal right to make the

In order to show your agreement with the DCO you should include at the end of commit message,
the following line: `Signed-off-by: John Doe <>`, using your real name.

This can be done easily using the [`-s`]( flag on the `git commit`.

## Support Channels

The official support channels, for both users and contributors, are:

- GitHub [issues](*
- Slack: #machine-learning room in the [source{d} Slack](

*Before opening a new issue or submitting a new pull request, it's helpful to
search the project - it's likely that another user has already reported the
issue you're facing, or it's a known issue that we're already aware of.
## How to Contribute
Pull Requests (PRs) are the main and exclusive way to contribute to the official go-asdf project.
In order for a PR to be accepted it needs to pass a list of requirements:
- All PRs must be written in idiomatic Go, formatted according to [gofmt -s](, [goimports](, and without any warnings from [go lint]( nor [go vet](
- New features should be generally covered with tests.
- The test suite must pass.
- All PRs have to pass the personal evaluation of at least one of the [maintainers](MAINTAINERS).
### Format of the commit message
The commit summary must start with a capital letter and with a verb in present tense. No dot in the end.
Add a feature
Remove unused code
Fix a bug
Every commit details should describe what was changed, under which context and, if applicable, the GitHub issue it relates to.
@@ -0,0 +1 @@
Vadim Markovtsev <> (@vmarkovtsev)
@@ -1,3 +1,21 @@
# go-asdf [![GoDoc](]( [![Build Status](]( [![codecov](]( [![Go Report Card](]( [![Apache 2.0 license](](

[Advanced Scientific Data Format]( reader in pure Go.
[Advanced Scientific Data Format]( reader library in pure Go.

The blocks are eagerly read and uncompressed. The tree is mapped with [gabs](

### Usage

import ""
fmt.Println(asdf.OpenFile("path/to/file.asdf", nil).Tree)

### Contributions

...are welcome, see [CONTRIBUTING]( and [code of conduct](

### License

Apache 2.0, see [LICENSE](LICENSE).
@@ -46,6 +46,9 @@ func OpenFile(fileName string, progress ProgressCallback) (*File, error) {
// Open reads ASDF from a seekable reader.
func Open(reader io.ReadSeeker, progress ProgressCallback) (*File, error) {
file := &File{}
if progress == nil {
progress = func(_, _ int) {}
progress(0, 2)
var err error
file.FormatVersion, file.StandardVersion, err = parseHeader(reader)
@@ -9,8 +9,7 @@ import (

func TestOpenFile(t *testing.T) {
req := require.New(t)
asdfFile, err := OpenFile("testdata/default.asdf",
func(done, total int) {})
asdfFile, err := OpenFile("testdata/default.asdf", nil)

0 comments on commit a0dc744

Please sign in to comment.
You can’t perform that action at this time.