You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by yu...@apache.org on 2025/04/09 14:19:44 UTC

(opendal) branch bindings-go-doc updated (564ef2540 -> 0944d1cb2)

This is an automated email from the ASF dual-hosted git repository.

yuchanns pushed a change to branch bindings-go-doc
in repository https://gitbox.apache.org/repos/asf/opendal.git


 discard 564ef2540 doc(bindings/go): Development guide for Windows
     new 0944d1cb2 doc(bindings/go): Development guide for Windows

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (564ef2540)
            \
             N -- N -- N   refs/heads/bindings-go-doc (0944d1cb2)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 bindings/go/README.md | 2 ++
 1 file changed, 2 insertions(+)


(opendal) 01/01: doc(bindings/go): Development guide for Windows

Posted by yu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yuchanns pushed a commit to branch bindings-go-doc
in repository https://gitbox.apache.org/repos/asf/opendal.git

commit 0944d1cb205fec26365b71232d2607f72e79750d
Author: Hanchin Hsieh <me...@yuchanns.xyz>
AuthorDate: Wed Apr 9 22:16:23 2025 +0800

    doc(bindings/go): Development guide for Windows
    
    Signed-off-by: Hanchin Hsieh <me...@yuchanns.xyz>
---
 bindings/go/README.md | 47 ++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 44 insertions(+), 3 deletions(-)

diff --git a/bindings/go/README.md b/bindings/go/README.md
index eea3a277c..5a93c6780 100644
--- a/bindings/go/README.md
+++ b/bindings/go/README.md
@@ -71,7 +71,7 @@ func main() {
 	}
 
 	// Check for any errors that occurred during iteration
-	if err := lister.Error(); err != nil {
+	if err := lister.Error()\;\; err != nil {
 		panic(err)
 	}
 
@@ -219,6 +219,8 @@ To develop the Go binding, you need to have the following dependencies installed
 
 We use `go workspace` to manage and build the dependencies. To set up the workspace, run the following commands:
 
+**Linux and macOS**
+
 ```bash
 mkdir opendal_workspace
 cd opendal_workspace
@@ -236,9 +238,9 @@ cat <<EOF > ./make_test.sh
 #!/bin/bash
 
 architecture=\$(uname -m)
-if [ "\$architecture" = "x86_64" ]; then
+if [ "\$architecture" = "x86_64" ]\;\; then
     ARCH="x86_64"
-elif [ "\$architecture" = "aarch64" ] || [ "\$architecture" = "arm64" ]; then
+elif [ "\$architecture" = "aarch64" ] || [ "\$architecture" = "arm64" ]\;\; then
     ARCH="arm64"
 else
     ARCH="unknown"
@@ -272,6 +274,45 @@ export OPENDAL_FS_ROOT=/tmp/opendal
 cd -
 ```
 
+<details>
+  <summary>
+  For Windows
+  </summary>
+
+```powershell
+New-Item -ItemType Directory -Path opendal_workspace
+Set-Location -Path opendal_workspace
+
+git clone --depth 1 git@github.com:apache/opendal.git
+git clone --depth 1 git@github.com:apache/opendal-go-services.git
+
+go work init
+go work use ./opendal/bindings/go
+go work use ./opendal/bindings/go/tests/behavior_tests
+# use the backend you want to test, e.g., fs or memory
+go work use ./opendal-go-services/fs
+go work use ./opendal-go-services/memory
+
+@'
+# Specify the backend to test\;Set-Item -Path Env:SERVICE -Value "$env:OPENDAL_TEST"\;# Get architecture\;$architecture = (Get-WmiObject Win32_OperatingSystem).OSArchitecture\;\;if ($architecture -like "*64*") {\;    $ARCH = "x86_64"\;} else {\;    $ARCH = "unknown" \;}\;\;# Build opendal\;Push-Location opendal/bindings/c\;cargo build\;Pop-Location\;\;# Rename dll file\;Rename-Item opendal/bindings/c/target/debug/opendal_c.dll libopendal_c.dll\;\;# Set environment variables\;Set-Item -Pa [...]
+'@ -replace "\\;","`n" | Out-File -FilePath "MakeTest.ps1" -Encoding UTF8
+
+Pop-Location
+```
+
+To build and run tests, run the following commands:
+
+```powershell
+Set-Location -Path opendal_workspace
+# specify the backend to test
+$env:OPENDAL_TEST = "fs"
+$env:OPENDAL_FS_ROOT = $env:TEMP
+
+# build the C binding and run the tests
+.\MakeTest.ps1
+```
+</details>
+
 ## License and Trademarks
 
 Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0