Added function to send a single value into a channel.

Is a wrapper for goroutines and similar where a return value can't be collected
Also added Goland's file things
This commit is contained in:
Samuel Becker 2023-01-19 12:51:46 +01:00
parent 5fbf5a7c8a
commit c50cf88dd0
5 changed files with 39 additions and 0 deletions

8
.idea/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

9
.idea/goutils.iml Normal file
View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

8
.idea/modules.xml Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/goutils.iml" filepath="$PROJECT_DIR$/.idea/goutils.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

8
pkg/other/other.go Normal file
View file

@ -0,0 +1,8 @@
package other
// OutputIntoChannel takes a singular return value and sends it into the target channel.
// This is a wrapper for functions where a value can't be collected from directly.
// Example: goroutines
func OutputIntoChannel[T any](out T, target chan T) {
target <- out
}