Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Olivia Server Relies On Unexported Global Variable Yet Exposes Public Functions #127

Open
bonedaddy opened this issue Jun 19, 2020 · 4 comments
Labels
kind:bug Something isn't working status:discussion

Comments

@bonedaddy
Copy link

server/serve.go relies on an unexported global variable called neuralNetworks which is set when running server.Serve however it exposes public functions like Reply and Train.

The inability to set neuralNetworks unless calling server.Serve negates the purpose of having public accessible functions like Reply and Train as these can't be used, unless you call server.Serve.

neuralNetworks should either be a publicly settable and gettable variable, or all public functions like Reply and Train should not be public, as they wont work unless you call server.Serve.

This means that its not possible to use the olivia server in third-party packages or repositories, even though it is written in such a way that it can be used by third party packages or repositories.

@bonedaddy bonedaddy added the kind:bug Something isn't working label Jun 19, 2020
@hugolgst
Copy link
Member

The suggestion is accurate and I will change that. However, Olivia isn’t a library and it isn’t built to be a package used externally.

@bonedaddy
Copy link
Author

Ah okay understandable. Is there any kind of limitation that would prevent it from being used as a library? It definitely is a one of a kind golang project, and in theory would allow people to build some cool stuff being used as a library.

@hugolgst
Copy link
Member

It is a great idea, however every part of the project relies on another one and it is a big puzzle. If you have any suggestions that would be great!

@bonedaddy
Copy link
Author

Ah okay that makes sense, I will think and let you know if I can think of anything else :D

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind:bug Something isn't working status:discussion
Projects
None yet
Development

No branches or pull requests

2 participants