Skip to content

Instantly share code, notes, and snippets.

package nslog
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Foundation
#import <Foundation/Foundation.h>
void Log(const char *text) {
NSString *nss = [NSString stringWithUTF8String:text];
NSLog(@"%@", nss);
}
@abemedia
abemedia / codesign.yml
Created April 3, 2021 15:35
github actions macos codesign
- name: Setup codesign
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
KEYCHAIN_NAME: hello
KEYCHAIN_PWD: hello
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p $KEYCHAIN_PWD $KEYCHAIN_NAME
security default-keychain -s $KEYCHAIN_NAME
@abemedia
abemedia / equal_test.go
Created March 21, 2023 01:48
Compare equal structs with different field order
package main_test
import (
"reflect"
"testing"
"github.com/google/go-cmp/cmp"
)
func TestEqual(t *testing.T) {
@abemedia
abemedia / workflow.yml
Created March 21, 2023 03:08
GitHub Actions Go Cache
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
cache: false