Skip to content

Instantly share code, notes, and snippets.

View yuen26's full-sized avatar
🎯
Focusing

Andy Nguyen yuen26

🎯
Focusing
View GitHub Profile
@yuen26
yuen26 / config.go
Created March 12, 2020 09:08
Golang read YAML file
package config
import "os"
import "log"
import "gopkg.in/yaml.v3"
const CONFIG_PATH = "/path/to/config.yml"
type Config struct {
Conn struct {
/**
* This configuration helps support for load javax/hibernate validator message by custom key
*
* @return
*/
@Bean
public Validator validator() {
final LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
factory.setValidationMessageSource(messageSource());
return factory;