Skip to content

Commit

Permalink
apacheGH-37779: [Go] Link to the pkg.go.dev site for Go reference docs (
Browse files Browse the repository at this point in the history
apache#37780)

### Rationale for this change

This change updates the Go `README.md` to point to the latest version of the reference documentation.

### What changes are included in this PR?

The Go `README.md` has been updated with a badge that points to [the v14 version](https://pkg.go.dev/github.com/apache/arrow/go/v14) of the docs.

In addition, the `dev/release/utils-prepare.sh` script has been modified so that the link in the Go `README.md` will be updated when the release version changes.

### Are these changes tested?

I tried running `PREPARE_CHANGELOG=0 ./dev/release/01-prepare.sh 14 15 1`, but I don't have `mvn` installed, so was not able to fully validate the changes.

In the `go` directory, I ran the following and confirmed that the changes looked like what I would expect:
```shell
find . "(" -name "*.go*" -o -name "go.mod" -o -name README.md ")" -exec sed -i.bak -E -e \
    "s|(github\\.com/apache/arrow/go)/v[0-9]+|\1/v15|g" {} \;
```

### Are there any user-facing changes?

Documentation changes only.
* Closes: apache#37779

Lead-authored-by: Tim Schaub <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Matt Topol <[email protected]>
  • Loading branch information
tschaub and kou authored Sep 20, 2023
1 parent fecb968 commit 6b1bcae
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
35 changes: 25 additions & 10 deletions dev/release/post-11-bump-versions-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def test_version_post_tag
]
end

Dir.glob("go/**/{go.mod,*.go,*.go.*}") do |path|
Dir.glob("go/**/{go.mod,*.go,*.go.*,README.md}") do |path|
if path == "go/arrow/doc.go"
expected_changes << {
path: path,
Expand All @@ -253,19 +253,34 @@ def test_version_post_tag
hunks = []
if release_type == :major
lines = File.readlines(path, chomp: true)
target_lines = lines.grep(/#{Regexp.escape(import_path)}/)
target_lines = lines.each_with_index.select do |line, i|
line.include?(import_path)
end
next if target_lines.empty?
hunk = []
target_lines.each do |line|
hunk << "-#{line}"
n_context_lines = 3 # The default of Git's diff.context
target_hunks = [[target_lines.first[0]]]
previous_i = target_lines.first[1]
target_lines[1..-1].each do |line, i|
if i - previous_i < n_context_lines
target_hunks.last << line
else
target_hunks << [line]
end
previous_i = i
end
target_lines.each do |line|
new_line = line.gsub("v#{@snapshot_major_version}") do
"v#{@next_major_version}"
target_hunks.each do |lines|
hunk = []
lines.each do |line,|
hunk << "-#{line}"
end
lines.each do |line|
new_line = line.gsub("v#{@snapshot_major_version}") do
"v#{@next_major_version}"
end
hunk << "+#{new_line}"
end
hunk << "+#{new_line}"
hunks << hunk
end
hunks << hunk
end
if path == "go/parquet/writer_properties.go"
hunks << [
Expand Down
4 changes: 2 additions & 2 deletions dev/release/utils-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ update_versions() {
popd

pushd "${ARROW_DIR}/go"
find . "(" -name "*.go*" -o -name "go.mod" ")" -exec sed -i.bak -E -e \
"s|(github\\.com/apache/arrow/go)/v[0-9]+|\1/v${major_version}|" {} \;
find . "(" -name "*.go*" -o -name "go.mod" -o -name README.md ")" -exec sed -i.bak -E -e \
"s|(github\\.com/apache/arrow/go)/v[0-9]+|\1/v${major_version}|g" {} \;
# update parquet writer version
sed -i.bak -E -e \
"s/\"parquet-go version .+\"/\"parquet-go version ${version}\"/" \
Expand Down
2 changes: 1 addition & 1 deletion go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Apache Arrow for Go
===================

[![GoDoc](https://godoc.org/github.com/apache/arrow/go/arrow?status.svg)](https://godoc.org/github.com/apache/arrow/go/arrow)
[![Go Reference](https://pkg.go.dev/badge/github.com/apache/arrow/go/v14.svg)](https://pkg.go.dev/github.com/apache/arrow/go/v14)

[Apache Arrow][arrow] is a cross-language development platform for in-memory
data. It specifies a standardized language-independent columnar memory format
Expand Down
6 changes: 3 additions & 3 deletions go/arrow/flight/flightsql/driver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ connection pooling, transactions combined with ease of use (see (#usage)).
## Prerequisites

* Go 1.17+
* Installation via `go get -u github.com/apache/arrow/go/v12/arrow/flight/flightsql`
* Installation via `go get -u github.com/apache/arrow/go/v14/arrow/flight/flightsql`
* Backend speaking FlightSQL

---------------------------------------
Expand All @@ -55,7 +55,7 @@ import (
"database/sql"
"time"

_ "github.com/apache/arrow/go/v12/arrow/flight/flightsql"
_ "github.com/apache/arrow/go/v14/arrow/flight/flightsql"
)

// Open the connection to an SQLite backend
Expand Down Expand Up @@ -141,7 +141,7 @@ import (
"log"
"time"

"github.com/apache/arrow/go/v12/arrow/flight/flightsql"
"github.com/apache/arrow/go/v14/arrow/flight/flightsql"
)

func main() {
Expand Down

0 comments on commit 6b1bcae

Please sign in to comment.