Skip to content

A demo application showcasing some of how Go's `internal` mechanism works

Notifications You must be signed in to change notification settings

cometbft/go-internalized-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Experiment: exposing internalized structs

This repo demonstrates that it's possible, in Go, to still access structs defined within internal if they're returned by public functions defined outside of internal.

  • The internalized module has a single package a which exposes a function MyFunc, returning an internal type.
  • The uses-internalized module has a main function which imports a.MyFunc, executes it and can access the internal type.

About

A demo application showcasing some of how Go's `internal` mechanism works

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages