THRIFT-5649: add github action for go (#2697)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 2187776..84b0042 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -51,6 +51,80 @@
           path: compiler/cpp/thrift
           retention-days: 3
 
+  lib-go:
+    needs: compiler
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v3
+
+      - uses: actions/setup-go@v3
+        with:
+          go-version: '>=1.17.0'
+
+      - name: Install dependencies
+        run: |
+          sudo apt-get update -yq
+          sudo apt-get install -y --no-install-recommends $BUILD_DEPS
+
+      - name: Run bootstrap
+        run: ./bootstrap.sh
+
+      - name: Run configure
+        run: |
+          ./configure \
+            --disable-debug \
+            --disable-tests \
+            --disable-dependency-tracking \
+            --without-cpp \
+            --without-c_glib \
+            --without-java \
+            --without-kotlin \
+            --without-python \
+            --without-py3 \
+            --without-ruby \
+            --without-haxe \
+            --without-netstd \
+            --without-perl \
+            --without-php \
+            --without-php_extension \
+            --without-dart \
+            --without-erlang \
+            --with-go \
+            --without-d \
+            --without-nodejs \
+            --without-nodets \
+            --without-lua \
+            --without-rs \
+            --without-swift
+
+      - uses: actions/download-artifact@v3
+        with:
+          name: thrift-compiler
+          path: compiler/cpp
+
+      - name: Run thrift-compiler
+        run: |
+          chmod a+x compiler/cpp/thrift
+          compiler/cpp/thrift -version
+
+      - name: Run make for go
+        run: make -C lib/go
+
+      - name: Run make check for go
+        run: make -C lib/go check
+
+      - name: Run make precross for go test
+        run: make -C test/go precross
+
+      - name: Upload go precross artifacts
+        uses: actions/upload-artifact@v3
+        with:
+          name: go-precross
+          if-no-files-found: error
+          path: |
+            test/go/bin/*
+          retention-days: 3
+
   lib-java-kotlin:
     needs: compiler
     runs-on: ubuntu-20.04
@@ -188,7 +262,7 @@
     runs-on: ubuntu-20.04
     steps:
       - uses: actions/checkout@v3
-      
+
       - name: Run bootstrap
         run: ./bootstrap.sh
 
@@ -219,7 +293,7 @@
             --without-lua \
             --without-rs \
             --with-swift
-            
+
       - uses: actions/download-artifact@v3
         with:
           name: thrift-compiler
@@ -229,7 +303,7 @@
         run: |
           chmod a+x compiler/cpp/thrift
           compiler/cpp/thrift -version
-          
+
       - name: Run make precross for swift
         run: make -C test/swift precross
 
@@ -337,12 +411,15 @@
       - lib-java-kotlin
       - lib-swift
       - lib-rust
+      - lib-go
     runs-on: ubuntu-20.04
     steps:
       - uses: actions/checkout@v3
+
       - uses: actions/setup-python@v3
         with:
           python-version: "3.x"
+
       - uses: actions/setup-java@v3
         with:
           distribution: temurin
@@ -350,6 +427,11 @@
           java-version: 8
           cache: "gradle"
 
+      - name: Install openssl and certificates (for SSL tests)
+        run: |
+          sudo apt-get update -yq
+          sudo apt-get install -y --no-install-recommends openssl ca-certificates
+
       - name: Download java precross artifacts
         uses: actions/download-artifact@v3
         with:
@@ -374,6 +456,12 @@
           name: rs-precross
           path: test/rs/bin
 
+      - name: Download go precross artifacts
+        uses: actions/download-artifact@v3
+        with:
+          name: go-precross
+          path: test/go/bin
+
       - name: Set back executable flags
         run: |
           chmod a+x \
@@ -381,12 +469,13 @@
             lib/kotlin/cross-test-client/build/install/TestClient/bin/* \
             lib/kotlin/cross-test-server/build/install/TestServer/bin/* \
             test/swift/CrossTests/.build/x86_64-unknown-linux-gnu/debug/* \
-            test/rs/bin/*
+            test/rs/bin/* \
+            test/go/bin/*
 
       - name: Run cross test
         env:
           THRIFT_CROSSTEST_CONCURRENCY: 4
-          PRECROSS_LANGS: java,kotlin,rs,swift
+          PRECROSS_LANGS: java,kotlin,go,rs,swift
         run: |
           python test/test.py \
             --retry-count 5 \
diff --git a/lib/java/src/test/java/org/apache/thrift/server/ServerTestBase.java b/lib/java/src/test/java/org/apache/thrift/server/ServerTestBase.java
index 6657df6..84a98a6 100644
--- a/lib/java/src/test/java/org/apache/thrift/server/ServerTestBase.java
+++ b/lib/java/src/test/java/org/apache/thrift/server/ServerTestBase.java
@@ -19,6 +19,7 @@
 package org.apache.thrift.server;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.nio.ByteBuffer;
@@ -344,9 +345,9 @@
 
   private void testBool(ThriftTest.Client testClient) throws TException {
     boolean t = testClient.testBool(true);
-    assertEquals(true, t);
+    assertTrue(t);
     boolean f = testClient.testBool(false);
-    assertEquals(false, f);
+    assertFalse(f);
   }
 
   private void testByte(ThriftTest.Client testClient) throws TException {
@@ -354,6 +355,12 @@
     assertEquals(1, i8);
   }
 
+  private void testUuid(ThriftTest.Client testClient) throws TException {
+    UUID uuid = UUID.fromString("00112233-4455-6677-8899-aabbccddeeff");
+    UUID got = testClient.testUuid(uuid);
+    assertEquals(uuid, got);
+  }
+
   private void testDouble(ThriftTest.Client testClient) throws TException {
     double dub = testClient.testDouble(5.325098235);
     assertEquals(5.325098235, dub);
@@ -469,6 +476,7 @@
       testStruct(testClient);
       testNestedStruct(testClient);
       testMap(testClient);
+      testUuid(testClient);
       testStringMap(testClient);
       testSet(testClient);
       testList(testClient);