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 <[email protected]>
AuthorDate: Wed Apr 9 22:16:23 2025 +0800

    doc(bindings/go): Development guide for Windows
    
    Signed-off-by: Hanchin Hsieh <[email protected]>
---
 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 [email protected]:apache/opendal.git
+git clone --depth 1 [email protected]: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

Reply via email to