This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Name of workflow to be displyed on Github Console | |
name: Build and Test Go Application | |
# Triggers the workflow on separate events | |
on: | |
push: | |
# Trigger the worflow on push event for all branches | |
branches: | |
- '**' | |
pull_request: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Name of workflow to be displyed on Github Console | |
name: Build and Test Go Application | |
# Triggers the workflow on separate events | |
on: | |
push: | |
# Trigger the worflow on push event for all branches | |
branches: | |
- '**' | |
pull_request: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package counter | |
// Count is an exported identifier of integer type | |
type Count int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package counter | |
// internalCounter is an unexported identifier of integer type | |
type internalCounter int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package counter | |
// internalCounter is an unexported identifier of integer type | |
type internalCounter int | |
// NewInternalCounter creates an object of internalCounter | |
// with value passed to it and returns | |
// an object of type internalCounter | |
func NewInternalCounter(val int) internalCounter { | |
return internalCounter(val) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package employee | |
//Exported struct type Employee with employee details | |
type Employee struct { | |
Name string | |
Age int | |
salary float64 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package employee | |
//Exported struct type Employee with employee details | |
type Employee struct { | |
Name string | |
Age int | |
salary float64 | |
} | |
func (e *Employee) SetSalary(val float64) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package animal | |
//Exported type struct | |
type Animal struct { | |
Name string | |
} | |
//Exported type Dog embedding type Animal | |
type Dog struct { | |
Animal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package animal | |
//Unexported type struct | |
type animal struct { | |
Name string | |
} | |
//Exported type Dog embedding type Animal | |
type Dog struct { | |
animal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/sagar23sj/Go-OOP/Encapsulation/animal" | |
) | |
func main() { | |
//Creating an object of type Dog from animal package |
OlderNewer