Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentvaroquauxads committed Jun 26, 2024
1 parent d063b83 commit 6a9fac9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 29 deletions.
6 changes: 3 additions & 3 deletions doc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,8 @@ func Example_vectorTutorial() {
// created geometry { "type": "Point", "coordinates": [ 1.0, 1.0 ] }
}

//ExampleErrorHandler_sentinel is an example to make godal.Open return a specific golang
//error when the gdal emitted error/log matches certain criteria
// ExampleErrorHandler_sentinel is an example to make godal.Open return a specific golang
// error when the gdal emitted error/log matches certain criteria
func ExampleErrorHandler_sentinel() {
sentinel := errors.New("noent")
eh := func(ec godal.ErrorCategory, code int, msg string) error {
Expand All @@ -547,7 +547,7 @@ func ExampleErrorHandler_sentinel() {
// noent
}

//ExampleErrorHandler_warnings is an example to set up an error handler that ignores gdal warnings
// ExampleErrorHandler_warnings is an example to set up an error handler that ignores gdal warnings
func ExampleErrorHandler_warnings() {
eh := func(ec godal.ErrorCategory, code int, msg string) error {
if ec <= godal.CE_Warning {
Expand Down
8 changes: 4 additions & 4 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package godal

//DriverName is GDAL driver
// DriverName is GDAL driver
type DriverName string

const (
Expand Down Expand Up @@ -128,7 +128,7 @@ type driversOpt struct {
drivers []string
}

//Drivers specifies the list of drivers that are allowed to try opening the dataset
// Drivers specifies the list of drivers that are allowed to try opening the dataset
func Drivers(drivers ...string) interface {
OpenOption
} {
Expand All @@ -142,8 +142,8 @@ type driverOpenOption struct {
oo []string
}

//DriverOpenOption adds a list of Open Options (-oo switch) to the open command. Each keyval must
//be provided in a "KEY=value" format
// DriverOpenOption adds a list of Open Options (-oo switch) to the open command. Each keyval must
// be provided in a "KEY=value" format
func DriverOpenOption(keyval ...string) interface {
OpenOption
BuildVRTOption
Expand Down
16 changes: 8 additions & 8 deletions histogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ type Bucket struct {
Count uint64
}

//Len returns the number of buckets contained in the histogram
// Len returns the number of buckets contained in the histogram
func (h Histogram) Len() int {
return len(h.counts)
}

//Bucket returns the i'th bucket in the histogram. i must be between 0 and Len()-1.
// Bucket returns the i'th bucket in the histogram. i must be between 0 and Len()-1.
func (h Histogram) Bucket(i int) Bucket {
width := (h.max - h.min) / float64(len(h.counts))
return Bucket{
Expand All @@ -52,12 +52,12 @@ type histogramOpts struct {
// HistogramOption is an option that can be passed to Band.Histogram()
//
// Available HistogramOptions are:
// - Approximate() to allow the algorithm to operate on a subset of the full resolution data
// - Intervals(count int, min,max float64) to compute a histogram with count buckets, spanning [min,max].
// Each bucket will be (max-min)/count wide. If not provided, the default histogram will be returned.
// - IncludeOutOfRange() to populate the first and last bucket with values under/over the specified min/max
// when used in conjuntion with Intervals()
// - ErrLogger
// - Approximate() to allow the algorithm to operate on a subset of the full resolution data
// - Intervals(count int, min,max float64) to compute a histogram with count buckets, spanning [min,max].
// Each bucket will be (max-min)/count wide. If not provided, the default histogram will be returned.
// - IncludeOutOfRange() to populate the first and last bucket with values under/over the specified min/max
// when used in conjuntion with Intervals()
// - ErrLogger
type HistogramOption interface {
setHistogramOpt(ho *histogramOpts)
}
Expand Down
12 changes: 6 additions & 6 deletions srs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ type srWKTOpts struct {
errorHandler ErrorHandler
}

//WKTExportOption is an option that can be passed to SpatialRef.WKT()
// WKTExportOption is an option that can be passed to SpatialRef.WKT()
//
// Available WKTExportOptions are:
// - ErrLogger
// - ErrLogger
type WKTExportOption interface {
setWKTExportOpt(sro *srWKTOpts)
}
Expand All @@ -35,7 +35,7 @@ type trnOpts struct {
// TransformOption is an option that can be passed to NewTransform
//
// Available TransformOptions are:
// - ErrLogger
// - ErrLogger
type TransformOption interface {
setTransformOpt(o *trnOpts)
}
Expand All @@ -52,8 +52,8 @@ type boundsOpts struct {
// BoundsOption is an option that can be passed to Dataset.Bounds or Geometry.Bounds
//
// Available options are:
// - *SpatialRef
// - ErrLogger
// - *SpatialRef
// - ErrLogger
type BoundsOption interface {
setBoundsOpt(o *boundsOpts)
}
Expand All @@ -66,7 +66,7 @@ type createSpatialRefOpts struct {
// reference object
//
// Available options are:
// - ErrLogger
// - ErrLogger
type CreateSpatialRefOption interface {
setCreateSpatialRefOpt(so *createSpatialRefOpts)
}
Expand Down
18 changes: 10 additions & 8 deletions statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ type statisticsOpts struct {
errorHandler ErrorHandler
}

//StatisticsOption is an option that can be passed to Band.Statistics
// StatisticsOption is an option that can be passed to Band.Statistics
//
//Available Statistics options are:
// Available Statistics options are:
// - Aproximate() to allow the satistics to be computed on overviews or a subset of all tiles.
// - ErrLogger
type StatisticsOption interface {
Expand All @@ -38,9 +38,10 @@ func (aoo approximateOkOption) setStatisticsOpt(so *statisticsOpts) {
so.approx = 1
}

//SetStatistics is an option that can passed to Band.SetStatistics()
//Available options are:
// -ErrLogger
// SetStatistics is an option that can passed to Band.SetStatistics()
// Available options are:
//
// -ErrLogger
type SetStatisticsOption interface {
setSetStatisticsOpt(sts *setStatisticsOpt)
}
Expand All @@ -49,9 +50,10 @@ type setStatisticsOpt struct {
errorHandler ErrorHandler
}

//ClearStatistics is an option passed to Dataset.ClearStatistics
//Available options are:
// -ErrLogger
// ClearStatistics is an option passed to Dataset.ClearStatistics
// Available options are:
//
// -ErrLogger
type ClearStatisticsOption interface {
setClearStatisticsOpt(sts *clearStatisticsOpt)
}
Expand Down

0 comments on commit 6a9fac9

Please sign in to comment.