title: Golang + cgo - AppDelegate implementation doesn't work
body: <p>I want to code an app in go that is able to open a custom filetype (.slc) on MacOS. I created a blank xcode project to get all the necessary code and implemented it via cgo into my app. When I double click a file the app opens but complains that it cannot open files in this format:</p>
  <p><a href="https://i.stack.imgur.com/wDwJp.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wDwJp.png" alt="enter image description here" /></a></p>
  <p>This is my Info.plist:</p>
  <p><a href="https://i.stack.imgur.com/EM2OV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/EM2OV.png" alt="enter image description here" /></a></p>
  <p>Implementation as follows:</p>
  <p><strong>/surge/appDelegate_darwin.go</strong></p>
  <pre><code>package surge
  
  //#cgo CFLAGS: -x objective-c
  //#cgo LDFLAGS: -framework Cocoa
  //#include &quot;appDelegate_darwin.h&quot;
  import &quot;C&quot;
  </code></pre>
  <p><strong>/surge/appDelegate_darwin.h</strong></p>
  <pre><code>#import &lt;Cocoa/Cocoa.h&gt;
  
  @interface AppDelegate : NSObject &lt;NSApplicationDelegate&gt;
  
  
  @end
  </code></pre>
  <p><strong>/surge/appDelegate_darwin.m</strong></p>
  <pre><code>#include &quot;appDelegate_darwin.h&quot;
  
  @interface AppDelegate ()
  
  @end
  
  @implementation AppDelegate
  
  -(BOOL)application:(NSApplication *)sender openFile:(NSString *)filename
  {
     NSLog(@&quot;%@&quot;, filename);
     YES;
  }
   
  -(void)application:(NSApplication *)sender openFiles:(NSArray *)filenames
  {
     NSLog(@&quot;%@&quot;, filenames);
  }
  
  - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
      // Insert code here to initialize your application
  }
  
  - (void)applicationWillTerminate:(NSNotification *)aNotification {
      // Insert code here to tear down your application
  }
  
  @end
  </code></pre>
  <p>Additional information: I use the wails framework (<a href="https://wails.app" rel="noreferrer">https://wails.app</a>) to add a nice vue.js frontend to the app and use the built-in <code>wails build</code> command.</p>
  <p>Other implementations in cgo and objective-c (like custom protocol handler) work.</p>