File: column_prego117_test.go

package info (click to toggle)
golang-github-biogo-hts 1.4.4%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,740 kB
  • sloc: makefile: 3
file content (24 lines) | stat: -rw-r--r-- 613 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright ©2021 The bíogo Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !go1.17
// +build !go1.17

package fai

import "encoding/csv"

// dropCSVColumn drops Column field information. It is required
// to harmonise behaviour between Go versions before and after
// v1.17. The relevant change in the standard library is 6d95e5a4.
func dropCSVColumn(err error) error {
	csvErr, ok := err.(*csv.ParseError)
	if !ok {
		return err
	}
	if csvErr.Err == csv.ErrFieldCount {
		csvErr.Column = 0
	}
	return csvErr
}